ELEMENT - Element typestatic class SortedArray.ComparatorNatural<ELEMENT>
extends java.lang.Object
implements java.util.Comparator<ELEMENT>
Comparable| Constructor and Description |
|---|
SortedArray.ComparatorNatural() |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(ELEMENT element1,
ELEMENT element2)
Compare 2 elements in "natural order" of
Comparable. |
public int compare(ELEMENT element1, ELEMENT element2)
Comparable.element1.compareTo(element2) compare in interface java.util.Comparator<ELEMENT>element1 - First element to compareelement2 - Second element to compareComparator.compare(java.lang.Object, java.lang.Object)