/** * ** Compares two RTKeys lexicographically. ** @param otherKey The key name to compare ** @return * 0 if the keys are equal, less-than 0 if this key is lexicographically ** less than the argument * key, and greater-than 0 if this key is ** lexicographically greater-than the key argument. */ public int compareTo(RTKey otherKey) { if (otherKey == null) { return 1; } else { return this.getName().compareTo(otherKey.getName()); } }
/** * ** Returns true if the specified key name is equal to the current key name. ** @param otherKey * The key name to test for equality ** @return True if equals, false otherwise */ public boolean equals(Object otherKey) { if (otherKey instanceof RTKey) { RTKey otherRTKey = (RTKey) otherKey; return this.getName().equals(otherRTKey.getName()); } else { return false; } }