com.groiss.ds
Class ComparablePair

java.lang.Object
  extended by com.groiss.ds.Pair
      extended by com.groiss.ds.ComparablePair
All Implemented Interfaces:
KeyValuePair, java.io.Serializable, java.lang.Comparable

public class ComparablePair
extends Pair
implements java.lang.Comparable

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.groiss.ds.Pair
first, second
 
Constructor Summary
ComparablePair(java.lang.Comparable key, java.lang.Object value)
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object obj)
          Returns true if obj is also a Pair and contains two objects equal to the two objects of this Pair.
 int hashCode()
          Builds a new hash code out of the two objects' hash codes.
 java.lang.String toString()
           
 
Methods inherited from class com.groiss.ds.Pair
getKey, getValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComparablePair

public ComparablePair(java.lang.Comparable key,
                      java.lang.Object value)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class Pair

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

equals

public boolean equals(java.lang.Object obj)
Description copied from class: Pair
Returns true if obj is also a Pair and contains two objects equal to the two objects of this Pair. null references are considered as equal, too.

Overrides:
equals in class Pair

hashCode

public int hashCode()
Description copied from class: Pair
Builds a new hash code out of the two objects' hash codes.

Overrides:
hashCode in class Pair


Copyright © 2001-2006 Groiss Informatics GmbH. All Rights Reserved.