public static class IlvSDMObjectComparator.ModelOrderSortCriteria extends IlvSDMObjectComparator.SortCriteria
ModelOrderSortCriteria
defines a sort criteria
to order the objects as in the SDM model.Constructor and Description |
---|
ModelOrderSortCriteria(IlvSDMEngine engine,
boolean isAscending)
Creates a new sort criteria that orders nodes and links
in the same (ascending) or in reverse (descending) order as the
order of objects in the SDM model.
|
ModelOrderSortCriteria(String description)
Creates a new sort criteria from a text description.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(Object modelObj1,
Object modelObj2)
Compares two data model objects according to the sort criteria.
|
IlvSDMModel |
getSDMModel()
Returns the SDM model containing the objects.
|
String |
getTextualDescription()
Returns the text description of this sort criteria.
|
boolean |
isAscending()
Tests the sort order.
|
void |
setAscending(boolean isAscending)
Sets the direction of the sorting order.
|
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 ModelOrderSortCriteria(IlvSDMEngine engine, boolean isAscending)
engine
- The SDM engine that has the model.isAscending
- Whether the order is ascending or descending.public ModelOrderSortCriteria(String description)
model,ascending
- uses the same order
as in the SDM model,model,descending
- uses the reverse order
as in the SDM model.description
- The text description of the comparator.getTextualDescription()
public final IlvSDMModel getSDMModel()
null
.public final void setAscending(boolean isAscending)
isAscending
- Set to true
so the sort is done
in the same order as in the SDM model, otherwise in reverse order.public final boolean isAscending()
true
is returned.public final String getTextualDescription()
IlvSDMObjectComparator.setTextualSortCriteria(java.lang.String)
.getTextualDescription
in class IlvSDMObjectComparator.SortCriteria
public int compare(Object modelObj1, Object modelObj2)
compare
in interface Comparator<Object>
compare
in class IlvSDMObjectComparator.SortCriteria
modelObj1
- A data model object.modelObj2
- A second data model object.java.util.Comparator
. The comparison
takes into account the sort order
indicated by isAscending()
.getSDMModel()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.