Class GremlinValueComparator
- java.lang.Object
- 
- org.apache.tinkerpop.gremlin.util.GremlinValueComparator
 
- 
- All Implemented Interfaces:
- Comparator<Object>
 
 public abstract class GremlinValueComparator extends Object implements Comparator<Object> An implementation of the Comparability/Orderability semantics as defined in the Apache TinkerPop Provider documentation.- Author:
- Mike Personick (http://github.com/mikepersonick)
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classGremlinValueComparator.TypeThe typespace.
 - 
Field SummaryFields Modifier and Type Field Description static GremlinValueComparatorCOMPARABILITYComparability has very similar semantics to orderability with the following exceptions: 1.static GremlinValueComparatorORDERABILITYOrderability comparator allows for a total order across all types (no type error exceptions).
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static booleancomparable(Object f, Object s)Return true if the two objects are of the same comparison type (although they may not be the exact same Class)protected Comparatorcomparator(GremlinValueComparator.Type type)abstract intcompare(Object f, Object s)Compare(a,b) is defined differently for Comparablity vs.abstract booleanequals(Object f, Object s)Equals(a,b) is defined differently for Comparablity (equality) vs.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface java.util.Comparatorequals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
 
- 
 
- 
- 
- 
Field Detail- 
ORDERABILITYpublic static final GremlinValueComparator ORDERABILITY Orderability comparator allows for a total order across all types (no type error exceptions).
 - 
COMPARABILITYpublic static final GremlinValueComparator COMPARABILITY Comparability has very similar semantics to orderability with the following exceptions: 1. NaN is not equal to anything, including itself, and cannot be compared to anything: equals(NaN, anything) = FALSE compare(NaN, anything) = ERROR 2. Unlike Orderability, Comparability is limited to a single type space: compare(type1, type2) = ERROR Note that because of type errors for Comparability, equals(a,b) does not necessarily produce the same result as compare(a,b) == 0. Make sure to use equals(a,b) for P.eq/neq.
 
- 
 - 
Method Detail- 
comparablepublic static boolean comparable(Object f, Object s) Return true if the two objects are of the same comparison type (although they may not be the exact same Class)
 - 
comparatorprotected Comparator comparator(GremlinValueComparator.Type type) 
 - 
comparepublic abstract int compare(Object f, Object s) Compare(a,b) is defined differently for Comparablity vs. Orderability.- Specified by:
- comparein interface- Comparator<Object>
 
 
- 
 
-