the type of the map entry keys
the type of the map entry values
true
if this cache is active.
Signifies whether or not this NamedMap
has been destroyed.
true
if this map contains no key-value mappings.
The name of this NamedMap
.
true
if this cache has been released
Signifies the number of key-value mappings in this map.
Add an index to this map.
The ValueExtractor object that is used to extract an indexable Object from a value stored in the indexed Map. Must not be null.
true iff the contents of the indexed information should be ordered false otherwise.
The Comparator object which imposes an ordering on entries in the indexed map or null if the entries' values natural ordering should be used.
A Promise
Add a MapListener that will receive events (inserts, updates, deletes) that occur against the map, with the key, old-value and new-value included.
the MapListener to receive events
the optional the key that identifies the entry for which to raise events or a filter that
will be passed MapEvent objects to select from; a MapEvent will be delivered to the
listener only if the filter evaluates to true for that MapEvent (see MapEventFilter);
null
is equivalent to a filter that always returns true
optionally pass true
to indicate that the MapEvent objects do not have to include the
old or new values in order to allow optimizations
Perform an aggregating operation against the entries specified by the passed keys.
the type of value returned by the EntryProcessor
the Iterable of keys that specify the entries within this Map to aggregate across
the EntryAggregator that is used to aggregate across the specified entries of this Map
Perform an aggregating operation against the set of entries that are selected by the given Filter.
the type of value returned by the EntryProcessor
the Filter that is used to select entries within this Map to aggregate across
the EntryAggregator that is used to aggregate across the specified entries of this Map
Perform an aggregating operation against all the entries.
the type of value returned by the EntryProcessor
the EntryAggregator that is used to aggregate across the specified entries of this Map
Clears all the mappings in the 'NamedMap'.
a Promise
which resolves once the operation is complete
Removes the mapping for a key from this map if it is present.
key whose mapping is to be removed from the map
a Promise
resolving to the previous value associated with key,
or null if there was no mapping for key
Release and destroy this cache.
Warning: This method is used to completely destroy the specified cache across the cluster. All references in the entire cluster to this cache will be invalidated, the cached data will be cleared, and all resources will be released.
Returns a Set view of the mappings contained in this map.
The set is backed by the map, so changes to the map are
reflected in the set, and vice-versa. If the map is modified
while an iteration over the set is in progress (except through
the iterator's own remove
operation) the results of the iteration
are undefined. The set supports element removal, which removes
the corresponding mapping from the map.
a set view of the mappings contained in this map
Return a set view of the entries contained in this map that satisfy the criteria expressed by the filter. Each element in the returned set is a MapEntry.
Unlike the entrySet()
method, the set returned by this method
may not be backed by the map, so changes to the set may not be reflected
in the map, and vice-versa.
the Filter object representing the criteria that the entries of this map should satisfy
the Comparator object which imposes an ordering on
entries in the resulting set; or null
if the
entries' values natural ordering should be used
a set of entries that satisfy the specified criteria
Perform the given action for each entry selected by the specified key set until all entries have been processed or the action raises an error.
Errors raised by the action are relayed to the caller.
The implementation processes each entry on the client and should only be used for read-only client-side operations (such as adding map entries to a UI widget, for example).
Any entry mutation caused by the specified action will not be propagated to the server when this method is called on a distributed map, so it should be avoided. The mutating operations on a subset of entries should be implemented using invokeAll.
the action to be performed for each entry
optional argument to be used as this when invoking the action
Perform the given action for each entry selected by the specified key set until all entries have been processed or the action raises an error.
Errors raised by the action are relayed to the caller.
The implementation processes each entry on the client and should only be used for read-only client-side operations (such as adding map entries to a UI widget, for example).
Any entry mutation caused by the specified action will not be propagated to the server when this method is called on a distributed map, so it should be avoided. The mutating operations on a subset of entries should be implemented using invokeAll.
the action to be performed for each entry
the keys to process these keys are not required to exist within the Map
optional argument to be used as this when invoking the action
Perform the given action for each entry selected by the specified key set until all entries have been processed or the action raises an error.
Errors raised by the action are relayed to the caller.
The implementation processes each entry on the client and should only be used for read-only client-side operations (such as adding map entries to a UI widget, for example).
Any entry mutation caused by the specified action will not be propagated to the server when this method is called on a distributed map, so it should be avoided. The mutating operations on a subset of entries should be implemented using invokeAll.
the action to be performed for each entry
the filter criteria to apply to the entries
optional argument to be used as this when invoking the action
Returns the value to which this cache maps the specified key.
the key whose associated value is to be returned
a Promise
resolving the value to which the specified key is mapped,
or null
if this map contains no mapping for the key
Get all the specified keys, if they are in the map. For each key that is in the map, that key and its corresponding value will be placed in the map that is returned by this method. The absence of a key in the returned map indicates that it was not in the cache, which may imply (for caches that can load behind the scenes) that the requested data could not be loaded.
an Iterable of keys that may be in this map
a Promise
resolving to a Map of keys to values for the specified keys
passed in keys
Returns the value to which the specified key is mapped, or the specified defaultValue
if this map contains no mapping for the key.
the value to which the specified key is mapped, or the specified defaultValue
if this map contains no mapping for the key
Returns true
if the specified key is mapped a value within the cache.
the key whose presence in this cache is to be tested
a Promise
resolving to true
if the key is mapped
to a value, or false
if it does not
Returns true
if the specified key is mapped to the specified value within the cache.
the key
the value
a Promise
resolving to true
if the key is mapped
to the specified value value, or false
if it does not
Returns true
if the specified value is mapped to some key.
the value expected to be associated with some key
a Promise
resolving to true
if a mapping exists,
or false
if it does not
Invoke the passed EntryProcessor against the {@link Entry} specified by the passed key, returning the result of the invocation.
the type of value returned by the EntryProcessor
the key to process it is not required to exist within the Map
the EntryProcessor to use to process the specified key
the result of the invocation as returned from the EntryProcessor
Invoke the passed EntryProcessor against the entries specified by the passed keys, returning the result of the invocation for each.
the type of value returned by the EntryProcessor
the EntryProcessor to use to process the specified keys
a Map containing the results of invoking the EntryProcessor against each of the specified keys
Invoke the passed EntryProcessor against the entries specified by the passed keys, returning the result of the invocation for each.
the type of value returned by the EntryProcessor
the keys to process these keys are not required to exist within the Map
the EntryProcessor to use to process the specified keys
Invoke the passed EntryProcessor against the set of entries that are selected by the given Filter, returning the result of the invocation for each.
Unless specified otherwise, implementations will perform this operation in two steps: 1. use the filter to retrieve a matching entry set 2. apply the agent to every filtered entry.
This algorithm assumes that the agent's processing does not affect the result of the specified filter evaluation, since the filtering and processing could be performed in parallel on different threads. If this assumption does not hold, the processor logic has to be idempotent, or at least re-evaluate the filter. This could be easily accomplished by wrapping the processor with the ConditionalProcessor.
the type of value returned by the EntryProcessor
a Filter that results in the set of keys to be processed
the EntryProcessor to use to process the specified keys
Returns a Set view of the keys contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map.
a set view of the keys contained in this map
Return a set view of the keys contained in this map for entries that satisfy the criteria expressed by the filter.
Unlike the {@link keySet()} method, the set returned by this method may not be backed by the map, so changes to the set may not reflected in the map, and vice-versa.
the Filter object representing the criteria that the entries of this map should satisfy
the comparator for sorting
a set of keys for entries that satisfy the specified criteria
Release local resources associated with instance.
Remove an index from this NamedMap
.
Removes an index to this NamedMap
. Example:
cache.removeIndex(Extractors.extract('name'))
The ValueExtractor object that is used to extract
an indexable Object from a value stored in the
indexed Map. Must not be null
.
A Promise
that resolves when the operation completes.
Remove a standard map listener that previously signed up for all events. This has the same result as the following call:
the MapListener to receive events
the key or filter passed to a previous addMapListener invocation
Removes the entry for the specified key only if it is currently mapped to the specified value.
key with which the specified value is associated
expected to be associated with the specified key
a Promise
resolving to true
if the value was removed
Replaces the entry for the specified key only if it is currently mapped to some value.
key with which the specified value is associated
value to be associated with the specified key
a Promise
resolving to the previous value associated with the specified key,
or null
if there was no mapping for the key. (A null
return can also indicate that the map
previously associated null
with the key, if the implementation supports null
values.)
Replaces the entry for the specified key only if currently mapped to the specified value.
key whose associated value is to be removed
value expected to be associated with the specified key
value to be associated with the specified key
a Promise
resolving to true
if the value was replaced
Associates the specified value with the specified key in this map. If the map previously contained a mapping for this key, the old value is replaced.
the key with which the specified value is to be associated
the value to be associated with the specified key
a Promise
resolving to the previous value associated with specified key,
or null
if there was no mapping for key. A null
return can also indicate that the map
previously associated null
with the specified key, if the implementation supports null
values
If the specified key is not already associated with a value (or is mapped to null
) associates
it with the given value and returns null
, else returns the current value.
the key with which the specified value is to be associated
the value to be associated with the specified key
a Promise
resolving to the previous value associated with the specified key, or
null
if there was no mapping for the key. (A null
return can also indicate that the map previously
associated null
with the key, if the implementation supports null
values.)
Truncates the cache. Unlike clear, this function does not generate an event for each removed entry.
a Promise
which resolves once the operation is complete
Returns a Set view of the values contained in this map.
The collection is backed by the map, so changes to the map are
reflected in the collection, and vice-versa. If the map is
modified while an iteration over the collection is in progress
(except through the iterator's own remove
operation),
the results of the iteration are undefined.
a Promise
that resolves to the values in the set
Return a Set of the values contained in this map that satisfy the criteria expressed by the filter.
Unlike the `values()` method, the collection returned by this method may not be backed by the map, so changes to the collection may not be reflected in the map, and vice-versa.
the Filter object representing the criteria that the entries of this map should satisfy
the Comparator object which imposes an ordering on entries in the resulting set; or null if the entries' values natural ordering should be used
a Promise
that resolves to the values in the set that satisfy
the specified criteria
A Map-based data-structure that manages entries across one or more processes. Entries are typically managed in memory, and are often comprised of data that is also stored persistently, on disk.