The mathIT Library
A Java™ API for mathematics
org.mathIT.algebra

## Class BigExponentComparator

• All Implemented Interfaces:
Comparator<BigInteger>

```public class BigExponentComparator
extends Object
implements Comparator<BigInteger>```
This class implements a comparator to enable descending order with respect to the exponents of a polynomial created by the class `PolynomialZ`.
Version:
1.3
Author:
Andreas de Vries
• ### Constructor Summary

Constructors
Constructor and Description
`BigExponentComparator()`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`int` ```compare(BigInteger x, BigInteger y)```
Compares its two arguments for order, which is reverse than the usual order.
• ### 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

`comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`
• ### Constructor Detail

• #### BigExponentComparator

`public BigExponentComparator()`
• ### Method Detail

• #### compare

```public int compare(BigInteger x,
BigInteger y)```
Compares its two arguments for order, which is reverse than the usual order. Returns a negative integer, zero, or a positive integer as the first argument is greater than, equal to, or less than the second.
Specified by:
`compare` in interface `Comparator<BigInteger>`
Parameters:
`x` - the first number to be compared
`y` - the second number to be compared
Returns:
-1 if `x>y`, 0 if `x==y`, or 1 if `x<y`