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 java.lang.Object implements KeyValuePair<O>
Implementation of theKeyValuePairinterface.
-
-
Constructor Summary
Constructors Constructor Description KeyValuePairImpl(java.lang.String key, java.lang.Object value)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Compares thisKeyValuePairobject with another for equality.java.lang.CharSequencegetKey()Returns the key with which the value is associatedOgetValue()Returns the value associated with the keyinthashCode()Returns a hash code for this object.java.lang.StringtoString()Returns a string representation as(key, value).
-
-
-
Field Detail
-
key
final java.lang.String key
-
value
final O value
-
-
Constructor Detail
-
KeyValuePairImpl
public KeyValuePairImpl(java.lang.String key, java.lang.Object value)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 Detail
-
getKey
public java.lang.CharSequence 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
public O getValue()
Returns the value associated with the key- Specified by:
getValuein interfaceKeyValuePair<O>- Returns:
- The value associated with the key
-
equals
public boolean equals(java.lang.Object o)
Compares thisKeyValuePairobject with another for equality. This is implemented based on equality of the keys.- Specified by:
equalsin interfaceKeyValuePair<O>- Overrides:
equalsin classjava.lang.Object- 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 classjava.lang.Object
-
toString
public java.lang.String toString()
Returns a string representation as(key, value).- Specified by:
toStringin interfaceKeyValuePair<O>- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation as
(key, value)
-
-