org.jrdf.graph.local.mem
Class NodeComparatorImpl

java.lang.Object
  extended by org.jrdf.graph.local.mem.NodeComparatorImpl
All Implemented Interfaces:
Serializable, Comparator<Node>, NodeComparator, TypedNodeVisitor

public final class NodeComparatorImpl
extends Object
implements NodeComparator, TypedNodeVisitor

Currently only support simple comparison - either by node id for blank nodes or string comparisons for URIs and Literals.

Version:
$Id: NodeComparatorImpl.java 1822 2008-01-17 22:20:02Z newmana $
Author:
Andrew Newman
See Also:
Serialized Form

Constructor Summary
NodeComparatorImpl(NodeTypeComparator nodeTypeComparator, BlankNodeComparator blankNodeComparator)
           
 
Method Summary
 int compare(Node o1, Node o2)
           
 void visitBlankNode(BlankNode blankNode)
          Visit blank node.
 void visitLiteral(Literal literal)
          Visit Literal.
 void visitNode(Node node)
          Visit node.
 void visitResource(Resource resource)
          Visit Resource.
 void visitURIReference(URIReference uriReference)
          Visit URI Reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

NodeComparatorImpl

public NodeComparatorImpl(NodeTypeComparator nodeTypeComparator,
                          BlankNodeComparator blankNodeComparator)
Method Detail

compare

public int compare(Node o1,
                   Node o2)
Specified by:
compare in interface Comparator<Node>

visitBlankNode

public void visitBlankNode(BlankNode blankNode)
Description copied from interface: TypedNodeVisitor
Visit blank node.

Specified by:
visitBlankNode in interface TypedNodeVisitor
Parameters:
blankNode - the blank node to visit.

visitURIReference

public void visitURIReference(URIReference uriReference)
Description copied from interface: TypedNodeVisitor
Visit URI Reference.

Specified by:
visitURIReference in interface TypedNodeVisitor
Parameters:
uriReference - the URI Reference to visit.

visitLiteral

public void visitLiteral(Literal literal)
Description copied from interface: TypedNodeVisitor
Visit Literal.

Specified by:
visitLiteral in interface TypedNodeVisitor
Parameters:
literal - the Literal to visit.

visitNode

public void visitNode(Node node)
Description copied from interface: TypedNodeVisitor
Visit node.

Specified by:
visitNode in interface TypedNodeVisitor
Parameters:
node - the node to visit.

visitResource

public void visitResource(Resource resource)
Description copied from interface: TypedNodeVisitor
Visit Resource.

Specified by:
visitResource in interface TypedNodeVisitor
Parameters:
resource - the node to visit.