Class StringProbComparator

java.lang.Object
  |
  +--StringProbComparator

public class StringProbComparator
extends java.lang.Object
implements java.util.Comparator

Used by SPTableModel to sort StringProbs.

Author:
Noah A. Smith
See Also:
SPTableModel, StringProb

Field Summary
static int PROBMETH
          For sorting alphabetically by the String.
static int STRINGMETH
           
 
Constructor Summary
StringProbComparator()
          Instantiate a new StringProbComparator.
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Perform comparison of 'o1' and 'o2' based on current method of comparison.
 boolean equals(java.lang.Object o)
          Determine if the object is a StringProbComparator.
 void setCompMethod(int m, boolean dir)
          Compare by method 'm' with direction 'dir' (true is default - A-Z or 1-0, false reverses the order).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRINGMETH

public static final int STRINGMETH

PROBMETH

public static final int PROBMETH
For sorting alphabetically by the String.
Constructor Detail

StringProbComparator

public StringProbComparator()
Instantiate a new StringProbComparator.
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Perform comparison of 'o1' and 'o2' based on current method of comparison.
Specified by:
compare in interface java.util.Comparator

equals

public boolean equals(java.lang.Object o)
Determine if the object is a StringProbComparator.
Specified by:
equals in interface java.util.Comparator
Overrides:
equals in class java.lang.Object

setCompMethod

public void setCompMethod(int m,
                          boolean dir)
Compare by method 'm' with direction 'dir' (true is default - A-Z or 1-0, false reverses the order).