Modifier and Type | Field and Description |
---|---|
static NumericTermComparator |
NUMERIC_TERM_COMPARATOR
Singleton instance
|
Modifier and Type | Method and Description |
---|---|
int |
compare(Numeric n1,
Numeric n2)
Compares two arguments, representing
Numeric terms, for order. |
int |
compare(Term t1,
Term t2,
ArithmeticOperators operators)
Compares the two arguments, representing arithmetic expressions, for order.
|
public static final NumericTermComparator NUMERIC_TERM_COMPARATOR
public int compare(Term t1, Term t2, ArithmeticOperators operators)
Returns a negative integer, zero, or a positive integer as the numeric value represented by the first argument is less than, equal to, or greater than the second.
Unlike compare(Numeric, Numeric)
this method will work for arguments that represent arithmetic
expressions (e.g. a Structure
of the form +(1,2)
) as well as Numeric
terms.
t1
- the first term to be comparedt2
- the second term to be comparedProjogException
- if either argument does not represent an arithmetic expressioncompare(Numeric, Numeric)
,
ArithmeticOperators.getNumeric(Term)
public int compare(Numeric n1, Numeric n2)
Numeric
terms, for order.
Returns a negative integer, zero, or a positive integer as the numeric value represented by the first argument is less than, equal to, or greater than the second.
n1
- the first term to be comparedn2
- the second term to be comparedcompare(Term, Term, ArithmeticOperators)
Copyright © 2024. All rights reserved.