org.jrdf.graph.global
Class GroundedTripleComparatorImpl

java.lang.Object
  extended by org.jrdf.graph.global.GroundedTripleComparatorImpl
All Implemented Interfaces:
Serializable, Comparator<Triple>, TripleComparator, TypedNodeVisitor

public class GroundedTripleComparatorImpl
extends Object
implements TripleComparator, TypedNodeVisitor

A different implementation of TripleComparator. Where the number of blank nodes in a triple makes it less than triples without blank nodes. Triples with the same number of blank nodes are then compared by node type.

See Also:
Serialized Form

Constructor Summary
GroundedTripleComparatorImpl(TripleComparator newTripleComparator)
           
 
Method Summary
 int compare(Triple o1, Triple 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

GroundedTripleComparatorImpl

public GroundedTripleComparatorImpl(TripleComparator newTripleComparator)
Method Detail

compare

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

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.