|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-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.net.cache.BackingMapBinaryEntry
public class BackingMapBinaryEntry
An implementation of the BinaryEntry interface that is based on specified binary key, binary value and BackingMapManagerContext. Analogous to the MapTrigger.Entry
, it represents a pending change to an Entry that is about to committed to the underlying Map. For example, the original binary value of null indicates pending insert (a non-existing entry), while the binary value of null represents a pending remove operation. <p/> It is currently only used by the ReadWriteBackingMap to communicate with the BinaryEntryStore. <p/> This implementation is not thread safe.
Field Summary | |
---|---|
protected Binary |
m_binKey The Binary key. |
protected Binary |
m_binValue The Binary value. |
protected Binary |
m_binValueOrig The original Binary value. |
protected BackingMapManagerContext |
m_ctx The backing map context. |
protected Object |
m_oKey Lazily converted key in Object format. |
protected Object |
m_oValue Lazily converted value in Object format. |
protected Object |
m_oValueOrig Lazily converted original value in Object format. |
protected static Binary |
NO_VALUE Marker object used to indicate that a lazily converted value has not yet been calculated. |
Constructor Summary | |
---|---|
BackingMapBinaryEntry(Binary binKey, Binary binValue, Binary binValueOrig, BackingMapManagerContext ctx) Construct a BackingMapBinaryEntry with the specified binary key, values and BackingMapManagerContext. |
Method Summary | |
---|---|
boolean |
equals(Object o) Compares the specified object with this entry for equality. |
Object |
extract(ValueExtractor extractor) Extract a value out of the Entry's value. |
Map |
getBackingMap() Obtain a reference to the backing map that this Entry corresponds to. |
Binary |
getBinaryKey() Return a raw binary key for this entry. |
Binary |
getBinaryValue() Return a raw binary value for this entry. |
BackingMapManagerContext |
getContext() Return the context this entry operates within. |
Object |
getKey() Return the key corresponding to this entry. |
Binary |
getOriginalBinaryValue() Return a raw original binary value for this entry. |
Object |
getOriginalValue() Return an original value for this entry. |
Serializer |
getSerializer() Return a Serializer that is used to serialize/deserialize this entry. |
Object |
getValue() Return the value corresponding to this entry. |
int |
hashCode() Returns the hash code value for this entry. |
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. |
Object |
setValue(Object oValue) Store the value corresponding to this entry. |
void |
setValue(Object oValue, boolean fSynthetic) Store the value corresponding to this entry. |
String |
toString() Render the entry as a String. |
void |
update(ValueUpdater updater, Object oValue) Update the Entry's value. |
void |
updateBinaryValue(Binary binValue) Update the binary value for this entry. |
Field Detail |
---|
protected BackingMapManagerContext m_ctx
protected Binary m_binKey
protected Binary m_binValue
protected Binary m_binValueOrig
protected Object m_oKey
protected Object m_oValue
protected Object m_oValueOrig
protected static final Binary NO_VALUE
Constructor Detail |
---|
public BackingMapBinaryEntry(Binary binKey, Binary binValue, Binary binValueOrig, BackingMapManagerContext ctx)
binKey
- the Binary keybinValue
- the Binary value; could be null representing a non-existing entrybinValueOrig
- an origianl Binary value; could be null representing an insert operationctx
- a BackingMapManagerContextMethod Detail |
---|
public Binary getBinaryKey()
getBinaryKey
in interface BinaryEntry
public Binary getBinaryValue()
getBinaryValue
in interface BinaryEntry
public Binary getOriginalBinaryValue()
getOriginalBinaryValue
in interface BinaryEntry
public Object getKey()
InvocableMap.Entry.isPresent()
, and to create the entry for the key, use InvocableMap.Entry.setValue(java.lang.Object)
.getKey
in interface InvocableMap.Entry
getKey
in interface Map.Entry
public Object getValue()
InvocableMap.Entry.isPresent()
. <p/> Note: any modifications to the value retrieved using this method are not guaranteed to persist unless followed by a InvocableMap.Entry.setValue(java.lang.Object)
or InvocableMap.Entry.update(com.tangosol.util.ValueUpdater, java.lang.Object)
call.getValue
in interface InvocableMap.Entry
getValue
in interface Map.Entry
public Object getOriginalValue()
getOriginalValue
in interface BinaryEntry
public Object setValue(Object oValue)
setValue
in interface InvocableMap.Entry
setValue
in interface Map.Entry
oValue
- the new value for this Entrypublic void setValue(Object oValue, boolean fSynthetic)
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.Entry
oValue
- the new value for this EntryfSynthetic
- pass true only if the insertion into or modification of the Map should be treated as a synthetic eventpublic void updateBinaryValue(Binary binValue)
setValue(getContext().getValueFromInternalConverter().convert(binValue));Passing null value is functionally equivalent to removing the entry.
remove(false);
updateBinaryValue
in interface BinaryEntry
binValue
- a raw binary value to for this entry or nullpublic Serializer getSerializer()
Serializer
that is used to serialize/deserialize this entry.getSerializer
in interface BinaryEntry
Serializer
that is used to serialize/deserialize this entrypublic BackingMapManagerContext getContext()
getContext
in interface BinaryEntry
public Map getBackingMap()
getBackingMap
in interface BinaryEntry
public void update(ValueUpdater updater, 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.Entry
updater
- a ValueUpdater used to modify the Entry's valueoValue
- the new value for this Entrypublic boolean isPresent()
InvocableMap.Entry.setValue(java.lang.Object)
or InvocableMap.Entry.setValue(java.lang.Object)
. If the Entry is present, it can be destroyed by calling InvocableMap.Entry.remove(boolean)
.isPresent
in interface InvocableMap.Entry
public void remove(boolean fSynthetic)
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.Entry
fSynthetic
- pass true only if the removal from the Map should be treated as a synthetic eventpublic Object extract(ValueExtractor extractor)
extract
in interface QueryMap.Entry
extractor
- a ValueExtractor to apply to the Entry's valuepublic boolean equals(Object o)
equals
in interface Map.Entry
o
- object to be compared for equality with this entrypublic int hashCode()
hashCode
in interface Map.Entry
Object.hashCode()
, Object.equals(Object)
, Map.Entry.equals(Object)
public String toString()
|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |