public class RingSizeComparator extends Object implements Comparator<IRing>
Modifier and Type | Field and Description |
---|---|
static int |
LARGE_FIRST
Flag to denote that the set is order with the largest ring first
|
static int |
SMALL_FIRST
Flag to denote that the set is order with the smallest ring first
|
Constructor and Description |
---|
RingSizeComparator(int order)
Constructs a new comparator to sort rings by size.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(IRing object1,
IRing object2) |
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 int LARGE_FIRST
public static final int SMALL_FIRST
public RingSizeComparator(int order)
order
- Sort order: either RingSet.SMALL_FIRST or
RingSet.LARGE_FIRST.public int compare(IRing object1, IRing object2) throws ClassCastException
compare
in interface Comparator<IRing>
ClassCastException
Copyright © 2022. All rights reserved.