org.openrdf.model
Interface Statement

All Superinterfaces:
Serializable
All Known Implementing Classes:
ContextStatementImpl, MemStatement, RdbmsStatement, StatementImpl

public interface Statement
extends Serializable

An RDF statement, with optional associated context. A statement can have an associated context in specific cases, for example when fetched from a repository. The context field does not influence statement equality; a statement is equal to another statement if the subjects, predicates and objects are equal.


Method Summary
 boolean equals(Object other)
          Compares a statement object to another object.
 Resource getContext()
          Gets the context of this statement.
 Value getObject()
          Gets the object of this statement.
 URI getPredicate()
          Gets the predicate of this statement.
 Resource getSubject()
          Gets the subject of this statement.
 int hashCode()
          The hash code of a statement is defined as: 961 * subject.hashCode() + 31 * predicate.hashCode() + object.hashCode().
 

Method Detail

getSubject

Resource getSubject()
Gets the subject of this statement.

Returns:
The statement's subject.

getPredicate

URI getPredicate()
Gets the predicate of this statement.

Returns:
The statement's predicate.

getObject

Value getObject()
Gets the object of this statement.

Returns:
The statement's object.

getContext

Resource getContext()
Gets the context of this statement.

Returns:
The statement's context, or null in case of the null context or if not applicable.

equals

boolean equals(Object other)
Compares a statement object to another object.

Overrides:
equals in class Object
Parameters:
other - The object to compare this statement to.
Returns:
true if the other object is an instance of Statement and if their subjects, predicates and objects are equal.

hashCode

int hashCode()
The hash code of a statement is defined as: 961 * subject.hashCode() + 31 * predicate.hashCode() + object.hashCode(). This is similar to how String.hashCode() is defined.

Overrides:
hashCode in class Object
Returns:
A hash code for the statement.


Copyright © 2001-2008 Aduna. All Rights Reserved.