Class ConcurrentRadixTree.KeyValuePairImpl<O>
java.lang.Object
com.googlecode.concurrenttrees.radix.ConcurrentRadixTree.KeyValuePairImpl<O>
- All Implemented Interfaces:
KeyValuePair<O>
- Enclosing class:
ConcurrentRadixTree<O>
public static class ConcurrentRadixTree.KeyValuePairImpl<O>
extends Object
implements KeyValuePair<O>
Implementation of the
KeyValuePair interface.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares thisKeyValuePairobject with another for equality.getKey()Returns the key with which the value is associatedgetValue()Returns the value associated with the keyinthashCode()Returns a hash code for this object.toString()Returns a string representation as(key, value).
-
Field Details
-
key
-
value
-
-
Constructor Details
-
KeyValuePairImpl
Constructor. Implementation node: This constructor currently requires the key to be supplied as aString- this is to allow reliable testing of object equality; the alternativeCharSequencedoes not specify a contract forObject.equals(Object).- Parameters:
key- The key as a stringvalue- The value
-
-
Method Details
-
getKey
Returns the key with which the value is associated- Specified by:
getKeyin interfaceKeyValuePair<O>- Returns:
- The key with which the value is associated
-
getValue
Returns the value associated with the key- Specified by:
getValuein interfaceKeyValuePair<O>- Returns:
- The value associated with the key
-
equals
Compares thisKeyValuePairobject with another for equality. This is implemented based on equality of the keys.- Specified by:
equalsin interfaceKeyValuePair<O>- Overrides:
equalsin classObject- Parameters:
o- The other object to compare- Returns:
- True if the other object is also a
KeyValuePairand is equal to this one as specified above
-
hashCode
public int hashCode()Returns a hash code for this object.- Specified by:
hashCodein interfaceKeyValuePair<O>- Overrides:
hashCodein classObject
-
toString
-