structure5
Class HashAssociation<K,V>
java.lang.Object
structure5.Association<K,V>
structure5.HashAssociation<K,V>
- All Implemented Interfaces:
- java.util.Map.Entry<K,V>
public class HashAssociation<K,V>
- extends Association<K,V>
Implements an association that can be marked "reserved". Reserved
associations can not be read without exception. Unreserved associations
act normally.
- See Also:
Hashtable, Association
Field Summary |
protected boolean |
reserved
|
Method Summary |
K |
getKey()
Fetch key from association. |
V |
getValue()
Fetch value from association. |
void |
reserve()
|
boolean |
reserved()
|
V |
setValue(V value)
Sets the value of the key-value pair. |
java.lang.String |
toString()
Standard string representation of an association. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
reserved
protected boolean reserved
HashAssociation
public HashAssociation(K key,
V value)
HashAssociation
public HashAssociation(K key)
getValue
public V getValue()
- Description copied from class:
Association
- Fetch value from association. May return null.
- Specified by:
getValue
in interface java.util.Map.Entry<K,V>
- Overrides:
getValue
in class Association<K,V>
- Returns:
- The value field of the association.
getKey
public K getKey()
- Description copied from class:
Association
- Fetch key from association. Should not return null.
- Specified by:
getKey
in interface java.util.Map.Entry<K,V>
- Overrides:
getKey
in class Association<K,V>
- Returns:
- Key of the key-value pair.
setValue
public V setValue(V value)
- Description copied from class:
Association
- Sets the value of the key-value pair.
- Specified by:
setValue
in interface java.util.Map.Entry<K,V>
- Overrides:
setValue
in class Association<K,V>
- Parameters:
value
- The new value.
reserved
public boolean reserved()
reserve
public void reserve()
toString
public java.lang.String toString()
- Description copied from class:
Association
- Standard string representation of an association.
- Overrides:
toString
in class Association<K,V>
- Returns:
- String representing key-value pair.