|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.SimpleMapEntry
public class SimpleMapEntry
A map entry (key-value pair). The Map.entrySet method returns a collection-view of the map, whose elements are of this class. The only way to obtain a reference to a map entry is from the iterator of this collection-view. These Map.Entry objects are valid only for the duration of the iteration; more formally, the behavior of a map entry is undefined if the backing map has been modified after the entry was returned by the iterator, except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator.
| Field Summary | |
|---|---|
protected java.lang.Object |
m_oKeyThe key. |
protected java.lang.Object |
m_oOrigValueThe original value. |
protected java.lang.Object |
m_oValueThe value. |
protected static java.lang.Object |
NO_VALUEConstant used to indicate that the original value does not exist. |
| Constructor Summary | |
|---|---|
protected |
SimpleMapEntry()Default constructor. |
|
SimpleMapEntry(java.util.Map.Entry entry)Copy constructor. |
protected |
SimpleMapEntry(java.lang.Object oKey)Construct a SimpleMapEntry with just a key. |
|
SimpleMapEntry(java.lang.Object oKey, java.lang.Object oValue)Construct a SimpleMapEntry with a key and a value. |
|
SimpleMapEntry(java.lang.Object oKey, java.lang.Object oValue, java.lang.Object oOrigValue)Construct a SimpleMapEntry with a key, value and original value. |
| Method Summary | |
|---|---|
java.lang.Object |
clone()Clone the Entry. |
boolean |
equals(java.lang.Object o)Compares the specified object with this entry for equality. |
java.lang.Object |
extract(ValueExtractor extractor)Extract a value out of the Entry's value. |
java.lang.Object |
getKey()Return the key corresponding to this entry. |
java.lang.Object |
getOriginalValue()Determine the value that existed before the start of the mutating operation that is being evaluated by the trigger. |
java.lang.Object |
getValue()Returns the value corresponding to this entry. |
int |
hashCode()Returns the hash code value for this map entry. |
boolean |
isOriginalPresent()Determine whether or not the Entry existed before the start of the mutating operation that is being evaluated by the trigger. |
boolean |
isPresent()Determine if this Entry exists in the Map. |
void |
remove(boolean fSynthetic)Remove this Entry from the Map if it is present in the Map. |
java.lang.Object |
setValue(java.lang.Object oValue)Replaces the value corresponding to this entry with the specified value (optional operation). |
void |
setValue(java.lang.Object oValue, boolean fSynthetic)Store the value corresponding to this entry. |
java.lang.String |
toString()Render the map entry as a String. |
void |
update(ValueUpdater updater, java.lang.Object oValue)Update the Entry's value. |
| Field Detail |
|---|
protected static final java.lang.Object NO_VALUE
protected java.lang.Object m_oKey
protected java.lang.Object m_oValue
protected java.lang.Object m_oOrigValue
| Constructor Detail |
|---|
protected SimpleMapEntry()
protected SimpleMapEntry(java.lang.Object oKey)
oKey - an object for the keypublic SimpleMapEntry(java.util.Map.Entry entry)
entry - an entry to copy from
public SimpleMapEntry(java.lang.Object oKey,
java.lang.Object oValue)
oKey - an object for the keyoValue - an object for the value
public SimpleMapEntry(java.lang.Object oKey,
java.lang.Object oValue,
java.lang.Object oOrigValue)
oKey - an object for the keyoValue - an object for the valueoOrigValue - an object for the original value| Method Detail |
|---|
public java.lang.Object getKey()
InvocableMap.Entry.isPresent(), and to create the entry for the key, use InvocableMap.Entry.setValue(java.lang.Object).getKey in interface InvocableMap.EntrygetKey in interface java.util.Map.Entrypublic java.lang.Object getValue()
getValue in interface InvocableMap.EntrygetValue in interface java.util.Map.Entrypublic java.lang.Object setValue(java.lang.Object oValue)
setValue in interface InvocableMap.EntrysetValue in interface java.util.Map.EntryoValue - new value to be stored in this entrypublic java.lang.Object getOriginalValue()
getOriginalValue in interface MapTrigger.Entrypublic boolean isOriginalPresent()
isOriginalPresent in interface MapTrigger.Entry
public void setValue(java.lang.Object oValue,
boolean fSynthetic)
Unlike the other form of setValue, this form does not return the previous value, and as a result may be significantly less expensive (in terms of cost of execution) for certain Map implementations.
setValue in interface InvocableMap.EntryoValue - the new value for this EntryfSynthetic - pass true only if the insertion into or modification of the Map should be treated as a synthetic event
public void update(ValueUpdater updater,
java.lang.Object oValue)
Object oTarget = entry.getValue(); updater.update(oTarget, oValue); entry.setValue(oTarget, false);The benefit of using this method is that it may allow the Entry implementation to significantly optimize the operation, such as for purposes of delta updates and backup maintenance.
update in interface InvocableMap.Entryupdater - a ValueUpdater used to modify the Entry's valueoValue - the new value for this Entrypublic boolean isPresent()
InvocableMap.Entry.setValue(Object) or InvocableMap.Entry.setValue(Object, boolean). If the Entry is present, it can be destroyed by calling InvocableMap.Entry.remove(boolean).isPresent in interface InvocableMap.Entrypublic void remove(boolean fSynthetic)
InvocableMap.EntryThis method supports both the operation corresponding to Map.remove(java.lang.Object) as well as synthetic operations such as eviction. If the containing Map does not differentiate between the two, then this method will always be identical to InvocableMap.this.remove(getKey()).
remove in interface InvocableMap.EntryfSynthetic - pass true only if the removal from the Map should be treated as a synthetic eventjava.lang.UnsupportedOperationExceptionpublic java.lang.Object extract(ValueExtractor extractor)
extract in interface QueryMap.Entryextractor - a ValueExtractor to apply to the Entry's valuepublic boolean equals(java.lang.Object o)
(e1.getKey()==null ?
e2.getKey()==null : e1.getKey().equals(e2.getKey())) &&
(e1.getValue()==null ?
e2.getValue()==null : e1.getValue().equals(e2.getValue()))
This ensures that the equals method works properly across different implementations of the Map.Entry interface.equals in interface java.util.Map.Entryo - object to be compared for equality with this map entrypublic int hashCode()
(e.getKey()==null ? 0 : e.getKey().hashCode()) ^
(e.getValue()==null ? 0 : e.getValue().hashCode())
This ensures that e1.equals(e2) implies that e1.hashCode()==e2.hashCode() for any two Entries e1 and e2, as required by the general contract of Object.hashCode.hashCode in interface java.util.Map.Entrypublic java.lang.String toString()
public java.lang.Object clone()
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||