org.jrdf.graph
Interface Triple

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractTriple

public interface Triple
extends Serializable

RDF Triple. An RDF triple as defined in "Resource Description Framework (RDF): Concepts and Abstract Syntax" 6.1 RDF Triples.

Version:
$Revision: 1.1 $
Author:
Simon Raboczi, Andrew Newman

Method Summary
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 ObjectNode getObject()
          Obtains the object of this statement.
 PredicateNode getPredicate()
          Obtains the predicate of this statement.
 SubjectNode getSubject()
          Obtains the subject of this statement.
 int hashCode()
          Returns a hash-code value for this triple.
 

Method Detail

getSubject

public SubjectNode getSubject()
Obtains the subject of this statement.

Returns:
an SubjectNode which is either a BlankNode or URIReference

getPredicate

public PredicateNode getPredicate()
Obtains the predicate of this statement.

Returns:
a PredicateNode which is a URIReference

getObject

public ObjectNode getObject()
Obtains the object of this statement.

Returns:
a ObjectNode which is either a BlankNode, URIReference or Literal

equals

public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one. A triple is equal to another triple if the subject, predicate and object are all equal.

Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

hashCode

public int hashCode()
Returns a hash-code value for this triple. The hash code is based upon XORing all of the components of a triple i.e. the subject, predicate and object.

Returns:
a hash-code value for this triple.