Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


com.tangosol.util
Class InvocableMapHelper.RoutingMapTriggerEntry

java.lang.Object
  extended by com.tangosol.util.InvocableMapHelper.RoutingMapTriggerEntry

All Implemented Interfaces:
InvocableMap.Entry, MapTrigger.Entry, QueryMap.Entry, java.util.Map.Entry
Direct Known Subclasses:
InvocableMapHelper.RoutingBinaryEntry
Enclosing class:
InvocableMapHelper

protected static class InvocableMapHelper.RoutingMapTriggerEntry
extends java.lang.Object
implements MapTrigger.Entry

MapTrigger.Entry wrapper that routes the getValue() call onto getOriginalValue().


Field Summary
protected  InvocableMap.Entry m_entry
          The underlying entry.

 

Constructor Summary
protected InvocableMapHelper.RoutingMapTriggerEntry(BinaryEntry entry)
          Construct a routing entry.
protected InvocableMapHelper.RoutingMapTriggerEntry(MapTrigger.Entry entry)
          Construct a routing entry.

 

Method Summary
 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()
          Return an OriginalValue from the underlying 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)
          Store the value corresponding to this entry.
 void setValue(java.lang.Object oValue, boolean fSynthetic)
          Store the value corresponding to this entry.
 void update(ValueUpdater updater, java.lang.Object oValue)
          Update the Entry's value.

 

Methods inherited from interface java.util.Map.Entry
equals, hashCode

 

Field Detail

m_entry

protected InvocableMap.Entry m_entry
The underlying entry. We artificially widen the type to be able to extend this class.

Constructor Detail

InvocableMapHelper.RoutingMapTriggerEntry

protected InvocableMapHelper.RoutingMapTriggerEntry(MapTrigger.Entry entry)
Construct a routing entry.
Parameters:
entry - the underlying MapTrigger.Entry

InvocableMapHelper.RoutingMapTriggerEntry

protected InvocableMapHelper.RoutingMapTriggerEntry(BinaryEntry entry)
Construct a routing entry.
Parameters:
entry - the underlying BinaryEntry

Method Detail

getKey

public java.lang.Object getKey()
Return the key corresponding to this entry. The resultant key does not necessarily exist within the containing Map, which is to say that InvocableMap.this.containsKey(getKey()) could return false. To test for the presence of this key within the Map, use InvocableMap.Entry.isPresent(), and to create the entry for the key, use InvocableMap.Entry.setValue(java.lang.Object).
Specified by:
getKey in interface InvocableMap.Entry
Specified by:
getKey in interface java.util.Map.Entry
Returns:
the key corresponding to this entry; may be null if the underlying Map supports null keys

getValue

public java.lang.Object getValue()
Return an OriginalValue from the underlying entry.
Specified by:
getValue in interface InvocableMap.Entry
Specified by:
getValue in interface java.util.Map.Entry
Returns:
the value corresponding to this entry; may be null if the value is null or if the Entry does not exist in the Map

extract

public java.lang.Object extract(ValueExtractor extractor)
Extract a value out of the Entry's value. Calling this method is semantically equivalent to extractor.extract(entry.getValue()), but this method may be significantly less expensive. For example, the resultant value may be obtained from a forward index, avoiding a potential object de-serialization.
Specified by:
extract in interface QueryMap.Entry
Parameters:
extractor - a ValueExtractor to apply to the Entry's value
Returns:
the extracted value

getOriginalValue

public java.lang.Object getOriginalValue()
Description copied from interface: MapTrigger.Entry
Determine the value that existed before the start of the mutating operation that is being evaluated by the trigger.
Specified by:
getOriginalValue in interface MapTrigger.Entry
Returns:
the original value corresponding to this Entry; may be null if the value is null or if the Entry did not exist in the Map
Throws:
java.lang.UnsupportedOperationException

setValue

public java.lang.Object setValue(java.lang.Object oValue)
Description copied from interface: InvocableMap.Entry
Store the value corresponding to this entry. If the entry does not exist, then the entry will be created by invoking this method, even with a null value (assuming the Map supports null values).
Specified by:
setValue in interface InvocableMap.Entry
Specified by:
setValue in interface java.util.Map.Entry
Parameters:
oValue - the new value for this Entry
Returns:
the previous value of this Entry, or null if the Entry did not exist
Throws:
java.lang.UnsupportedOperationException

setValue

public void setValue(java.lang.Object oValue,
                     boolean fSynthetic)
Description copied from interface: InvocableMap.Entry
Store the value corresponding to this entry. If the entry does not exist, then the entry will be created by invoking this method, even with a null value (assuming the Map supports null values).

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.

Specified by:
setValue in interface InvocableMap.Entry
Parameters:
oValue - the new value for this Entry
fSynthetic - pass true only if the insertion into or modification of the Map should be treated as a synthetic event
Throws:
java.lang.UnsupportedOperationException

update

public void update(ValueUpdater updater,
                   java.lang.Object oValue)
Description copied from interface: InvocableMap.Entry
Update the Entry's value. Calling this method is semantically equivalent to:
   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.
Specified by:
update in interface InvocableMap.Entry
Parameters:
updater - a ValueUpdater used to modify the Entry's value
oValue - the new value for this Entry
Throws:
java.lang.UnsupportedOperationException

remove

public void remove(boolean fSynthetic)
Description copied from interface: InvocableMap.Entry
Remove this Entry from the Map if it is present in the Map.

This 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()).

Specified by:
remove in interface InvocableMap.Entry
Parameters:
fSynthetic - pass true only if the removal from the Map should be treated as a synthetic event
Throws:
java.lang.UnsupportedOperationException

isPresent

public boolean isPresent()
Description copied from interface: InvocableMap.Entry
Determine if this Entry exists in the Map. If the Entry is not present, it can be created by calling 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).
Specified by:
isPresent in interface InvocableMap.Entry
Returns:
true iff this Entry is existent in the containing Map
Throws:
java.lang.UnsupportedOperationException

isOriginalPresent

public boolean isOriginalPresent()
Description copied from interface: MapTrigger.Entry
Determine whether or not the Entry existed before the start of the mutating operation that is being evaluated by the trigger.
Specified by:
isOriginalPresent in interface MapTrigger.Entry
Returns:
true iff this Entry was existent in the containing Map
Throws:
java.lang.UnsupportedOperationException

Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.