public class GridBoundedConcurrentOrderedMap<K,V> extends ConcurrentSkipListMap<K,V>
evictionListener(org.apache.ignite.lang.IgniteBiInClosure)
method, then listener
will be notified for every eviction.
Note that due to concurrent nature of this map, it may grow slightly larger than its maximum allowed size, but in this case it will quickly readjust back to allowed size.
Note that remove(Object)
and remove(Object, Object)
methods
are not supported for this kind of map.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
GridBoundedConcurrentOrderedMap(int max)
Constructs a new, empty map that orders its elements according to
their natural ordering.
|
GridBoundedConcurrentOrderedMap(int max,
Comparator<? super K> comparator)
Constructs a new, empty set that orders its elements according to
the specified comparator.
|
GridBoundedConcurrentOrderedMap(int max,
Map<? extends K,? extends V> map)
Constructs a new map containing the elements in the specified
map, that orders its elements according to their
natural ordering.
|
GridBoundedConcurrentOrderedMap(int max,
SortedMap<K,V> map)
Constructs a new map containing the same elements and using the
same ordering as the specified sorted map.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
GridBoundedConcurrentOrderedMap<K,V> |
clone() |
IgniteBiInClosure<K,V> |
evictionListener()
Gets closure listener to be called for every eviction event.
|
void |
evictionListener(IgniteBiInClosure<K,V> lsnr)
Sets closure listener to be called for every eviction event.
|
V |
put(K k,
V v) |
V |
putIfAbsent(K k,
V v) |
V |
remove(Object o)
This method is not supported and always throws
UnsupportedOperationException . |
boolean |
remove(Object key,
Object val)
This method is not supported and always throws
UnsupportedOperationException . |
int |
size()
Approximate size at this point of time.
|
ceilingEntry, ceilingKey, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, equals, firstEntry, firstKey, floorEntry, floorKey, get, headMap, headMap, higherEntry, higherKey, isEmpty, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, replace, replace, subMap, subMap, tailMap, tailMap, values
hashCode, putAll, toString
public GridBoundedConcurrentOrderedMap(int max)
max
- Upper bound of this map.public GridBoundedConcurrentOrderedMap(int max, Comparator<? super K> comparator)
max
- Upper bound of this map.comparator
- The comparator that will be used to order this map.
If null, the natural
ordering of the elements will be used.public GridBoundedConcurrentOrderedMap(int max, Map<? extends K,? extends V> map)
max
- Upper bound of this map.map
- The elements that will comprise the new map.ClassCastException
- if the elements in map are
not Comparable
, or are not mutually comparable.NullPointerException
- if the specified map or any
of its elements are null
.public GridBoundedConcurrentOrderedMap(int max, SortedMap<K,V> map)
max
- Upper bound of this map.map
- Sorted map whose elements will comprise the new map.NullPointerException
- if the specified sorted map or any
of its elements are null
.public void evictionListener(IgniteBiInClosure<K,V> lsnr)
lsnr
- Closure to be called for every eviction event.public IgniteBiInClosure<K,V> evictionListener()
@Nullable public V putIfAbsent(K k, V v)
putIfAbsent
in interface ConcurrentMap<K,V>
putIfAbsent
in class ConcurrentSkipListMap<K,V>
public int size()
size
methods on other concurrent
collections, this method executes
in constant time without traversal of the elements.public GridBoundedConcurrentOrderedMap<K,V> clone()
clone
in class ConcurrentSkipListMap<K,V>
public V remove(Object o)
UnsupportedOperationException
.public boolean remove(Object key, Object val)
UnsupportedOperationException
.remove
in interface ConcurrentMap<K,V>
remove
in class ConcurrentSkipListMap<K,V>
key
- val
-
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017