org.locomotive.util.data
Interface ComparisonKey
- All Known Implementing Classes:
- DateKey, NameKey, NumberKey, StringKey
- public interface ComparisonKey
Defines the compare function to allow arbitrary objects to be
compared.
Method Summary |
int |
compare(ComparisonKey otherKey)
Compare myself to another object |
java.lang.String |
toString()
to assure a decent string representation of the comparisonKey |
compare
public int compare(ComparisonKey otherKey)
throws ComparisonKeyException
- Compare myself to another object
- Parameters:
otherKey
- - the key to which this object is to be
compared- Returns:
- -1 - if this object is "less" than otherKey
1 - if this object is "greater" than otherKey
0 - if this object is equivalent to otherKey - Throws:
- ComparisonKeyException -
if otherKey cannot be compared with this object
toString
public java.lang.String toString()
- to assure a decent string representation of the comparisonKey
- Overrides:
- toString in class java.lang.Object