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 TypeMethodDescriptionboolean
Compares thisKeyValuePair
object with another for equality.getKey()
Returns the key with which the value is associatedgetValue()
Returns the value associated with the keyint
hashCode()
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 alternativeCharSequence
does 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:
getKey
in interfaceKeyValuePair<O>
- Returns:
- The key with which the value is associated
-
getValue
Returns the value associated with the key- Specified by:
getValue
in interfaceKeyValuePair<O>
- Returns:
- The value associated with the key
-
equals
Compares thisKeyValuePair
object with another for equality. This is implemented based on equality of the keys.- Specified by:
equals
in interfaceKeyValuePair<O>
- Overrides:
equals
in classObject
- Parameters:
o
- The other object to compare- Returns:
- True if the other object is also a
KeyValuePair
and is equal to this one as specified above
-
hashCode
public int hashCode()Returns a hash code for this object.- Specified by:
hashCode
in interfaceKeyValuePair<O>
- Overrides:
hashCode
in classObject
-
toString
Returns a string representation as(key, value)
.- Specified by:
toString
in interfaceKeyValuePair<O>
- Overrides:
toString
in classObject
- Returns:
- A string representation as
(key, value)
-