public static class IlvSDMObjectComparator.ComparatorSortCriteria extends IlvSDMObjectComparator.SortCriteria
ComparatorSortCriteria
defines a sort criteria
by using an implementation of java.util.Comparator
.Constructor and Description |
---|
ComparatorSortCriteria(Comparator<Object> comparator)
Creates a new comparator sort criteria that relies on the
given comparator.
|
ComparatorSortCriteria(String description)
Creates a new comparator sort criteria from a text description.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(Object gobj1,
Object gobj2)
Compares two graphic objects using the comparator.
|
Comparator<Object> |
getComparator()
Returns the comparator used to perform the comparison.
|
String |
getTextualDescription()
Returns the text description of this sort criteria.
|
void |
setComparator(Comparator<Object> comparator)
Sets the comparator used to perform the comparison.
|
createFromTextualDescription
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 ComparatorSortCriteria(Comparator<Object> comparator)
comparator
- The comparator used to test values.public ComparatorSortCriteria(String description)
comparator,ASCENDING_WIDTH
,comparator,DESCENDING_WIDTH
,comparator,ASCENDING_HEIGHT
,comparator,DESCENDING_HEIGHT
,comparator,ASCENDING_AREA
,comparator,DESCENDING_AREA
.comparator,classname
- the second part of the
description must be a fully qualified class name of a comparator
class that has a default constructor.description
- The text description of the comparator.getTextualDescription()
public final void setComparator(Comparator<Object> comparator)
comparator
- The comparator.public final Comparator<Object> getComparator()
public final String getTextualDescription()
IlvSDMObjectComparator.setTextualSortCriteria(java.lang.String)
.getTextualDescription
in class IlvSDMObjectComparator.SortCriteria
public int compare(Object gobj1, Object gobj2)
compare
in interface Comparator<Object>
compare
in class IlvSDMObjectComparator.SortCriteria
gobj1
- One graphic object.gobj2
- Another graphic object.java.util.Comparator
. The comparison
takes into account the sort order as indicated by
getComparator()
.getComparator()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.