org.nsdl.mptstore.rdf
Interface Node

All Known Subinterfaces:
ObjectNode, PredicateNode, SubjectNode
All Known Implementing Classes:
Literal, URIReference

public interface Node

Common interface for all RDF subjects, predicates, and objects.

Author:
cwilper@cs.cornell.edu

Method Summary
 boolean equals(java.lang.Object obj)
          Tell whether this Node should be considered equivalent to the given object.
 java.lang.String getValue()
          Get the lexical value of the node.
 int hashCode()
          Return a hash code for this node.
 java.lang.String toString()
          Get an N-Triples string representing this node.
 

Method Detail

getValue

java.lang.String getValue()
Get the lexical value of the node.

The lexical value of a URIReference node is the URI as a string.

The lexical value of a Literal node is a string representation of the value, and does not include the language or data type, if any.

Returns:
the lexical value, never null.

toString

java.lang.String toString()
Get an N-Triples string representing this node.

For URIReference nodes, this is <$uri>.

For Literal nodes, this is one of the following:

Note:

Overrides:
toString in class java.lang.Object
Returns:
the N-Triples representation of the node.
See Also:
RDF Test Cases, Section 3: N-Triples

equals

boolean equals(java.lang.Object obj)
Tell whether this Node should be considered equivalent to the given object.

A URIReference node is equal to the given object if all of the following conditions are met:

A Literal node is equal to the given object if all of the following conditions are met:

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare to this one.
Returns:
true if the objects are equal according to the rules above.

hashCode

int hashCode()
Return a hash code for this node.

The hash code of a URIReference is the hash code of getURI(). The hash code of a Literal is the hash code of getValue().

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code.