org.norvelle.textcite.model.sort
Class SortComparator
java.lang.Object
org.norvelle.textcite.model.sort.SortComparator
- Direct Known Subclasses:
- AuthorSortComparator, BookSortComparator, OutlineSortComparator, PageRefSortComparator
public abstract class SortComparator
- extends java.lang.Object
The classes derived from this superclass can be used to compare two citations on a given field, and to signal listeners that the compared field is not equal (i.e. that there has been a change from, e.g. one author or one book to another between the compared Citations.
Constructor Summary |
SortComparator(int direction)
The superclass constructor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DESCENDING
public static final int DESCENDING
- See Also:
- Constant Field Values
ASCENDING
public static final int ASCENDING
- See Also:
- Constant Field Values
direction
protected int direction
SortComparator
public SortComparator(int direction)
- The superclass constructor. Just saves the direction of the comparison.
- Parameters:
direction
- One of the directional values ASCENDING or DESCENDING
compare
public abstract int compare(Citation citation1,
Citation citation2)
- Returns:
- a negative integer, zero, or a positive integer as the first object is less than, equal to, or greater than the second object.
getDirection
public int getDirection()
signalChange
public abstract void signalChange(Citation changedCitation)