M
- the model typepublic static class Store.StoreSortInfo<M> extends Object implements Comparator<M>
Constructor and Description |
---|
Store.StoreSortInfo(Comparator<? super M> itemComparator,
SortDir direction)
Creates a sort info object based on the given comparator to act on the
item itself.
|
Store.StoreSortInfo(ValueProvider<? super M,V> property,
Comparator<? super V> itemComparator,
SortDir direction)
Creates a sort info object to act on a property of the items and a custom
comparator for that property's type.
|
Store.StoreSortInfo(ValueProvider<? super M,V> property,
SortDir direction)
Convenience constructor for sorting based on a
Comparable
property of items in the store. |
Modifier and Type | Method and Description |
---|---|
int |
compare(M o1,
M o2) |
SortDir |
getDirection()
Returns the current sort direction for this sort info.
|
String |
getPath()
If the sort info object is configured to act on a property of the items,
returns the path that the property's ValueProvider makes available,
otherwise returns empty string.
|
ValueProvider<? super M,?> |
getValueProvider()
Returns the sort property's ValueProvider.
|
void |
setDirection(SortDir direction)
Sets a new sort direction.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals
public Store.StoreSortInfo(Comparator<? super M> itemComparator, SortDir direction)
itemComparator
- the comparator to use to sort the itemsdirection
- the sort directionpublic Store.StoreSortInfo(ValueProvider<? super M,V> property, Comparator<? super V> itemComparator, SortDir direction)
V
- the property typeproperty
- the sort propertyitemComparator
- the comparator to use in the sortdirection
- the sort directionpublic Store.StoreSortInfo(ValueProvider<? super M,V> property, SortDir direction)
Comparable
property of items in the store.V
- the property typeproperty
- the sort propertydirection
- the sort directionpublic int compare(M o1, M o2)
compare
in interface Comparator<M>
public SortDir getDirection()
public String getPath()
public ValueProvider<? super M,?> getValueProvider()
public void setDirection(SortDir direction)
Store.applySort(boolean)
is called on the store containing the
sort info.direction
- the sort directionCopyright © 2015. All rights reserved.