public static class IlvSDMObjectComparator.DataModelAttributeSortCriteria extends IlvSDMObjectComparator.SortCriteria
DataModelAttributeSortCriteria
defines a sort criteria
that allows you to specify the order using data model attributes
of the objects.Constructor and Description |
---|
DataModelAttributeSortCriteria(String description)
Creates a new data model sort criteria from a text description.
|
DataModelAttributeSortCriteria(String attributeName,
boolean isAscending)
Creates a new data model sort criteria instance for a given data model
attribute and sort order.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(Object modelObj1,
Object modelObj2)
Compares two data model objects according to the sort criteria.
|
String |
getAttributeName()
Returns the name of the data model attribute used as sort
criteria.
|
IlvSDMModel |
getSDMModel()
Returns the SDM model containing the objects.
|
String |
getTextualDescription()
Returns the text description of the sort criteria.
|
boolean |
isAscending()
Tests the sort order.
|
void |
setAscending(boolean isAscending)
Sets the direction of the sorting order.
|
void |
setAttributeName(String attributeName)
Sets the data model attribute name.
|
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 DataModelAttributeSortCriteria(String attributeName, boolean isAscending)
attributeName
- The name of the attribute.isAscending
- Set to true
to set an ascending
sort order.public DataModelAttributeSortCriteria(String description)
data,name,ascending
, which sorts according to the
name attribute of the data model objects in ascending order.description
- This parameter must match the format
defined by that particular class of sort criteria and must be
consistent with the format used by getTextualDescription()
.getTextualDescription()
public final IlvSDMModel getSDMModel()
null
.public final void setAscending(boolean isAscending)
isAscending
- Set to true
so the sort is done
in ascending order.public final boolean isAscending()
true
is
returned.public final void setAttributeName(String attributeName)
attributeName
- An attribute name.public final String getAttributeName()
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
- One data model object.modelObj2
- Another 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.