org.softevo.ample.ui
Class AbstractSorter

java.lang.Object
  extended by org.eclipse.jface.viewers.ViewerSorter
      extended by org.softevo.ample.ui.AbstractSorter
Direct Known Subclasses:
PatternSorter, RankingSorter

public abstract class AbstractSorter
extends org.eclipse.jface.viewers.ViewerSorter


Field Summary
protected  int ascending
           
protected  int mode
           
 
Fields inherited from class org.eclipse.jface.viewers.ViewerSorter
collator
 
Constructor Summary
AbstractSorter(boolean ascending, int mode)
           
 
Method Summary
protected abstract  int compare(java.lang.Object first, java.lang.Object second)
           
 int compare(org.eclipse.jface.viewers.Viewer viewer, java.lang.Object first, java.lang.Object second)
          Returns a negative, zero, or positive number depending on whether the first element is less than, equal to, or greater than the second element.
 boolean getAscending()
           
 int getMode()
           
 void setAscending(boolean ascending)
           
 
Methods inherited from class org.eclipse.jface.viewers.ViewerSorter
category, getCollator, isSorterProperty, sort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ascending

protected int ascending

mode

protected int mode
Constructor Detail

AbstractSorter

public AbstractSorter(boolean ascending,
                      int mode)
Method Detail

setAscending

public void setAscending(boolean ascending)

compare

public final int compare(org.eclipse.jface.viewers.Viewer viewer,
                         java.lang.Object first,
                         java.lang.Object second)
Returns a negative, zero, or positive number depending on whether the first element is less than, equal to, or greater than the second element.

Overrides:
compare in class org.eclipse.jface.viewers.ViewerSorter
Parameters:
viewer - The owner viewer.
first - The first element.
second - The second element.
Returns:
A negative number if the first element is less than the second element; the value 0 if the first element is equal to the second element; and a positive number if the first element is greater than the second element.

compare

protected abstract int compare(java.lang.Object first,
                               java.lang.Object second)

getAscending

public boolean getAscending()

getMode

public int getMode()