Package org.dellroad.stuff.vaadin7
Interface SortingPropertyExtractor<T>
-
- Type Parameters:
T- target object type for extraction
- All Superinterfaces:
PropertyExtractor<T>
- All Known Implementing Classes:
StringValuePropertyDef
public interface SortingPropertyExtractor<T> extends PropertyExtractor<T>
PropertyExtractorthat also sorts properties, given two instances of the target Java type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanSort(PropertyDef<?> propertyDef)Determine if the given property can be sorted by this instance.intsort(PropertyDef<?> propertyDef, T obj1, T obj2)Sort two values based on the given property.-
Methods inherited from interface org.dellroad.stuff.vaadin7.PropertyExtractor
getPropertyValue
-
-
-
-
Method Detail
-
canSort
boolean canSort(PropertyDef<?> propertyDef)
Determine if the given property can be sorted by this instance. If this method returns false, then the property's sorting resorts to the default behavior, i.e., depending on whether the property value implementsComparable.- Parameters:
propertyDef- definition of property- Returns:
- true if the property defined by
propertyDefcan be sorted by this instance - Throws:
NullPointerException- ifpropertyDefis null
-
sort
int sort(PropertyDef<?> propertyDef, T obj1, T obj2)
Sort two values based on the given property.- Parameters:
obj1- first Java objectobj2- second Java objectpropertyDef- definition of property to sort on- Returns:
- result of comparing
obj1's property value toobj2's property value - Throws:
NullPointerException- if any parameter is nullUnsupportedOperationException- if the property defined bypropertyDefcannot be sorted by this instance
-
-