|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.app.util.ScalableHashMap.PrefixEntry<K,V>
static class ScalableHashMap.PrefixEntry<K,V>
An implementation of Entry that incorporates information about
the prefix at which it is stored, as well as whether the ScalableHashMap is responsible for the persistent lifetime of the key
and value.
If a key or value that does not implement ManagedObject is
stored in the map, then it is wrapped using the ManagedSerializable utility class so that the entry may have a ManagedReference to the value, rather than a standard reference.
This class performs an optimization if both key and value do not
implement ManagedObject. In this case, both objects will be
stored together in a KeyValuePair, which reduces the number of
accesses to the data store.
Note that the ordering of entries depends on the object ID of the managed object that represents the key. To insure the proper behavior of the iterator, that object ID must not change after the entry is created. The object ID used is either that of the key itself, if the key is a managed object, or that of the ManagedSerializable wrapper created to wrap either the just key or both the key and value. In either case, the managed object associated with the key is determined in the constructor
ManagedSerializable| Field Summary | |
|---|---|
(package private) int |
hash
The hash value for this entry. |
(package private) ScalableHashMap.PrefixEntry<K,V> |
next
The next chained entry in this entry's bucket. |
(package private) byte |
state
The state of the key and value, which is either a non-zero combination of the KEY_WRAPPED and VALUE_WRAPPED, or is KEY_VALUE_PAIR. |
| Constructor Summary | |
|---|---|
ScalableHashMap.PrefixEntry(int h,
K k,
V v)
Constructs a new PrefixEntry. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
|
K |
getKey()
Returns the key stored by this entry. |
V |
getValue()
Returns the value stored by this entry. |
int |
hashCode()
|
(package private) ManagedReference<?> |
keyRef()
Returns the ManagedReference for the key used in this entry. |
V |
setValue(V newValue)
Replaces the previous value of this entry with the provided value. |
(package private) void |
setValueInternal(V newValue)
Replaces the previous value of this entry with the provided value. |
String |
toString()
Returns the string form of this entry as entry=value. |
(package private) void |
unmanage()
Removes any Serializable managed by this entry from the data
manager. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
ScalableHashMap.PrefixEntry<K,V> next
final int hash
byte state
| Constructor Detail |
|---|
ScalableHashMap.PrefixEntry(int h,
K k,
V v)
PrefixEntry.
h - the hash code for the keyk - the keyv - the value| Method Detail |
|---|
public final K getKey()
ObjectNotFoundException will be thrown.
getKey in interface Map.Entry<K,V>ObjectNotFoundException - if the key in the backing map was
removed prior to this callManagedReference<?> keyRef()
ManagedReference for the key used in this entry.
These references are not guaranteed to stay valid across
transactions and should therefore not be used except for
comparisons.
ManagedReference for the keyScalableHashMap.ConcurrentIteratorpublic final V getValue()
ObjectNotFoundException will be thrown.
getValue in interface Map.Entry<K,V>ObjectNotFoundException - if the value in the backing map was
removed prior to this callpublic final V setValue(V newValue)
setValue in interface Map.Entry<K,V>newValue - the value to be stored
void setValueInternal(V newValue)
newValue - the value to be storedpublic final boolean equals(Object o)
equals in interface Map.Entry<K,V>equals in class Objectpublic final int hashCode()
hashCode in interface Map.Entry<K,V>hashCode in class Objectpublic String toString()
entry=value.
toString in class Objectfinal void unmanage()
Serializable managed by this entry from the data
manager. This should only be called from ScalableHashMap.clear, ScalableHashMap.remove, or remove under the condition that this entry's map-managed object
will never be referenced again by the map.
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||