Package org.aksw.jenax.arq.util.node
Class ComparableNode
java.lang.Object
org.aksw.jenax.arq.util.node.ComparableNode
- All Implemented Interfaces:
Serializable,Comparable<ComparableNode>
A wrapper that makes Nodes comparable by rdf term equivalence.
For example, "5"^^xsd:int DOES NOT equal "5"^^xsd:double.
Allows for use in guava's RangeSet.
- Author:
- raven
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(ComparableNode that) Compare strictly by value if possible.booleanorg.apache.jena.graph.NodegetNode()inthashCode()toString()static ComparableNodewrap(org.apache.jena.graph.Node node)
-
Field Details
-
node
protected org.apache.jena.graph.Node node
-
-
Constructor Details
-
ComparableNode
protected ComparableNode(org.apache.jena.graph.Node node)
-
-
Method Details
-
getNode
public org.apache.jena.graph.Node getNode() -
wrap
-
compareTo
Compare strictly by value if possible. Comparing 5 (int) to to 5.0 (double) can thus yield 0. In contrast,NodeValue.compareAlways(NodeValue, NodeValue)discriminates equal values further by the rdf term. fallback to lexical comparison- Specified by:
compareToin interfaceComparable<ComparableNode>
-
toString
-
hashCode
public int hashCode() -
equals
-