org.sStu
Class CharComparator

java.lang.Object
  extended byorg.sStu.CharComparator

public abstract class CharComparator
extends java.lang.Object

Class for comparing two characters in the sequence.

Author:
Audrius Meskauskas
See Also:
http://www.gnu.org/licenses/gpl.txt

Constructor Summary
CharComparator()
           
 
Method Summary
 int compare(char[] A, int i, char[] B, int j)
          Compares characters at A[i] and B[j].
abstract  int compare(char a, char b)
          Return the score of comparison of the two characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CharComparator

public CharComparator()
Method Detail

compare

public abstract int compare(char a,
                            char b)
Return the score of comparison of the two characters. Implementing classed must override this method.

Returns:
The score of comparison of the two characters a and b

compare

public int compare(char[] A,
                   int i,
                   char[] B,
                   int j)
Compares characters at A[i] and B[j]. Sophisticated comparison algorithms may use comparison strategies that take the value of the neighbouring characters into account. The default method calls compare(char a, char b),

Returns:
The score of comparison of the two characters a and b