public final class TermComparator extends Object implements Comparator<Term>
Comparator
for comparing instances of Term
.Modifier and Type | Field and Description |
---|---|
static TermComparator |
TERM_COMPARATOR
Singleton instance
|
Modifier and Type | Method and Description |
---|---|
int |
compare(Term t1,
Term t2)
Compares the two arguments for order.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public static final TermComparator TERM_COMPARATOR
public int compare(Term t1, Term t2)
Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
The criteria for deciding the order of terms is as follows:
NumericTermComparator
.String
values they represent using
String.compareTo(String)
.String.compareTo(String)
). If two structures have the same arity and functor then they are ordered by
comparing their arguments in order. The first corresponding arguments that differ determines the order of the two
structures.compare
in interface Comparator<Term>
t1
- the first term to be comparedt2
- the second term to be comparedCopyright © 2024. All rights reserved.