| java.lang.Object javolution.util.FastComparator
Inner Class :final static class StringComparator extends FastComparator | |
Method Summary | |
abstract public boolean | areEqual(Object o1, Object o2) Indicates if the specified objects can be considered equal.
Parameters: o1 - the first object (or null ). Parameters: o2 - the second object (or null ). | abstract public int | compare(Object o1, Object o2) Compares the specified objects for order. | abstract public int | hashCodeOf(Object obj) Returns the hash code for the specified object (consistent with
FastComparator.areEqual ). |
LEXICAL | final public static FastComparator LEXICAL(Code) | | Holds a lexicographic comparator for any
CharSequence or
String instances.
Two objects are considered
FastComparator.areEqual equal if and only if they
represents the same character sequence). The hashcode is calculated
using the following formula (same as for java.lang.String ):
s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
|
STRING | final public static FastComparator STRING(Code) | | Holds a fast comparator for java.lang.String . Hashcodes
are calculated by taking a sample of few characters instead of
the whole string.
|
_Rehash | static boolean _Rehash(Code) | | |
areEqual | abstract public boolean areEqual(Object o1, Object o2)(Code) | | Indicates if the specified objects can be considered equal.
Parameters: o1 - the first object (or null ). Parameters: o2 - the second object (or null ). true if both objects are considered equal;false otherwise. |
compare | abstract public int compare(Object o1, Object o2)(Code) | | Compares the specified objects for order. Returns a negative integer,
zero, or a positive integer as the first argument is less than, equal to,
or greater than the second.
Parameters: o1 - the first object. Parameters: o2 - the second object. a negative integer, zero, or a positive integer as the firstargument is less than, equal to, or greater than the second. throws: NullPointerException - if any of the specified object is null . |
|
|