dsto.dfc.databeans
Interface ISorter<T>

All Superinterfaces:
Comparator<T>
All Known Subinterfaces:
IFilterSorter<T>
All Known Implementing Classes:
CategorySorter, FederatedSorterFilter, PropertySorterFilter

public interface ISorter<T>
extends Comparator<T>

Interface for view sorters.

See Also:
DataObjectView

Field Summary
static IFilterSorter DEFAULT_SORTER
          A sorter that delegates to DefaultComparator.
static ISorter NULL_SORTER
          A sorter that does nothing.
 
Method Summary
 boolean affectsOrder(PropertyPath path)
          Return true if a change to a given path might affect the sort order of the object at the root of the path.
 int compare(T o1, T o2)
          See Comparator.compare(Object, Object).
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

NULL_SORTER

static final ISorter NULL_SORTER
A sorter that does nothing.


DEFAULT_SORTER

static final IFilterSorter DEFAULT_SORTER
A sorter that delegates to DefaultComparator.

Method Detail

compare

int compare(T o1,
            T o2)
See Comparator.compare(Object, Object).

Specified by:
compare in interface Comparator<T>

affectsOrder

boolean affectsOrder(PropertyPath path)
Return true if a change to a given path might affect the sort order of the object at the root of the path. This is an opportunity for optimization: simply returning true will work at the cost of some wasted ovehead.



Copyright © 2008 Commonwealth of Australia