Javolution 6.0.0 java
|
Public Member Functions | |
FastSortedMap () | |
FastSortedMap (Equality<? super K > keyComparator) | |
FastSortedMap (Equality<? super K > keyComparator, Equality<? super V > valueComparator) | |
FastSortedMap< K, V > | atomic () |
FastSortedMap< K, V > | shared () |
FastSortedMap< K, V > | unmodifiable () |
FastSortedSet< Entry< K, V > > | entrySet () |
FastSortedSet< K > | keySet () |
FastSortedMap< K, V > | subMap (K fromKey, K toKey) |
FastSortedMap< K, V > | headMap (K toKey) |
FastSortedMap< K, V > | tailMap (K fromKey) |
boolean | containsKey (Object key) |
V | get (Object key) |
V | put (K key, V value) |
V | remove (Object key) |
V | putIfAbsent (K key, V value) |
boolean | remove (Object key, Object value) |
boolean | replace (K key, V oldValue, V newValue) |
V | replace (K key, V value) |
K | firstKey () |
K | lastKey () |
Comparator<? super K > | comparator () |
FastSortedMap< K, V > | putAll (FastMap<? extends K, ? extends V > that) |
FastMap< K, V > | parallel () |
FastMap< K, V > | sequential () |
FastCollection< V > | values () |
void | perform (Consumer<? extends Map< K, V >> action) |
void | update (Consumer<? extends Map< K, V >> action) |
int | size () |
boolean | isEmpty () |
boolean | containsValue (Object value) |
void | putAll (Map<? extends K, ? extends V > map) |
void | clear () |
String | toString () |
Protected Member Functions | |
FastSortedMap (SortedMapService< K, V > service) | |
SortedMapService< K, V > | service () |
Package Functions | |
public< T extends Map< K, V > > Immutable< T > | toImmutable () |
Static Private Attributes | |
static final long | serialVersionUID = 0x600L |
A high-performance sorted map with real-time behavior.
This map provides a total ordering based on the keys natural order or using custom comparators.
Definition at line 34 of file FastSortedMap.java.
javolution.util.FastSortedMap< K, V >.FastSortedMap | ( | ) |
Creates an empty sorted map ordered on keys natural order.
Definition at line 42 of file FastSortedMap.java.
References javolution.util.function.Equalities.STANDARD.
javolution.util.FastSortedMap< K, V >.FastSortedMap | ( | Equality<? super K > | keyComparator | ) |
Creates an empty sorted map ordered using the specified comparator for order.
Definition at line 50 of file FastSortedMap.java.
References javolution.util.function.Equalities.STANDARD.
javolution.util.FastSortedMap< K, V >.FastSortedMap | ( | Equality<? super K > | keyComparator, |
Equality<? super V > | valueComparator | ||
) |
Creates an empty sorted map ordered using the specified key comparator for order and value comparator for values equality.
Definition at line 58 of file FastSortedMap.java.
|
protected |
Creates a sorted map backed up by the specified service implementation.
Definition at line 66 of file FastSortedMap.java.
References javolution.util.FastSortedMap< K, V >.service().
FastSortedMap<K, V> javolution.util.FastSortedMap< K, V >.atomic | ( | ) |
Returns an atomic view over this map. All operations that write or access multiple elements in the map (such as putAll(), keySet().retainAll(), ...) are atomic. Iterators on atomic collections are thread-safe (no ConcurrentModificationException possible).
Reimplemented from javolution.util.FastMap< K, V >.
Definition at line 75 of file FastSortedMap.java.
References javolution.util.FastSortedMap< K, V >.service().
|
inherited |
Removes all this map's entries.
Definition at line 343 of file FastMap.java.
Comparator<? super K> javolution.util.FastSortedMap< K, V >.comparator | ( | ) |
Returns the comparator used to order the keys in this map (never null).
Definition at line 188 of file FastSortedMap.java.
References javolution.util.FastSortedMap< K, V >.keySet().
boolean javolution.util.FastSortedMap< K, V >.containsKey | ( | Object | key | ) |
Indicates if this map contains the specified key.
Reimplemented from javolution.util.FastMap< K, V >.
Definition at line 124 of file FastSortedMap.java.
|
inherited |
Indicates if this map contains the specified value.
Definition at line 308 of file FastMap.java.
FastSortedSet<Entry<K, V> > javolution.util.FastSortedMap< K, V >.entrySet | ( | ) |
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. The set support adding/removing entries. As far as the set is concerned, two entries are considered equals if they have the same keys regardless of their values.
Reimplemented from javolution.util.FastMap< K, V >.
Definition at line 91 of file FastSortedMap.java.
References javolution.util.FastSortedMap< K, V >.service().
K javolution.util.FastSortedMap< K, V >.firstKey | ( | ) |
Returns the first (lowest) key currently in this map.
Definition at line 176 of file FastSortedMap.java.
References javolution.util.FastSortedMap< K, V >.service().
Referenced by javolution.util.FastSortedMap< K, V >.headMap().
V javolution.util.FastSortedMap< K, V >.get | ( | Object | key | ) |
Returns the value for the specified key.
Reimplemented from javolution.util.FastMap< K, V >.
Definition at line 130 of file FastSortedMap.java.
FastSortedMap<K, V> javolution.util.FastSortedMap< K, V >.headMap | ( | K | toKey | ) |
Returns a view of the portion of this map whose keys are strictly less than toKey.
Definition at line 108 of file FastSortedMap.java.
References javolution.util.FastSortedMap< K, V >.firstKey(), javolution.util.FastSortedMap< K, V >.service(), and javolution.util.FastSortedMap< K, V >.subMap().
|
inherited |
Indicates if this map is empty
Definition at line 294 of file FastMap.java.
FastSortedSet<K> javolution.util.FastSortedMap< K, V >.keySet | ( | ) |
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. The set supports adding new keys for which the corresponding entry value is always
.
Reimplemented from javolution.util.FastMap< K, V >.
Definition at line 96 of file FastSortedMap.java.
References javolution.util.FastSortedMap< K, V >.service().
Referenced by javolution.util.FastSortedMap< K, V >.comparator().
K javolution.util.FastSortedMap< K, V >.lastKey | ( | ) |
Returns the last (highest) key currently in this map.
Definition at line 182 of file FastSortedMap.java.
References javolution.util.FastSortedMap< K, V >.service().
Referenced by javolution.util.FastSortedMap< K, V >.tailMap().
|
inherited |
Returns a parallel map. Parallel maps affect closure-based operations over the map or any of its views (entry, key, values, etc.), all others operations behaving the same. Parallel maps do not require this map to be thread-safe (internal synchronization).
Definition at line 178 of file FastMap.java.
|
inherited |
Executes the specified read-only action on this map. That logic may be performed concurrently on sub-maps if this map is parallel.
action | the read-only action. |
UnsupportedOperationException | if the action tries to update this map. |
ClassCastException | if the action type is not compatible with this map (e.g. action on sorted map and this is a hash map). |
Definition at line 258 of file FastMap.java.
V javolution.util.FastSortedMap< K, V >.put | ( | K | key, |
V | value | ||
) |
Associates the specified value with the specified key.
Reimplemented from javolution.util.FastMap< K, V >.
Definition at line 136 of file FastSortedMap.java.
FastSortedMap<K, V> javolution.util.FastSortedMap< K, V >.putAll | ( | FastMap<? extends K, ? extends V > | that | ) |
Returns this map with the specified map's entries added.
Reimplemented from javolution.util.FastMap< K, V >.
Definition at line 197 of file FastSortedMap.java.
|
inherited |
Adds the specified map entries to this map.
Definition at line 329 of file FastMap.java.
Referenced by javolution.util.FastMap< Object, javolution.util.Index >.putAll().
V javolution.util.FastSortedMap< K, V >.putIfAbsent | ( | K | key, |
V | value | ||
) |
Associates the specified value with the specified key only if the specified key has no current mapping.
Reimplemented from javolution.util.FastMap< K, V >.
Definition at line 148 of file FastSortedMap.java.
V javolution.util.FastSortedMap< K, V >.remove | ( | Object | key | ) |
Removes the entry for the specified key.
Reimplemented from javolution.util.FastMap< K, V >.
Definition at line 142 of file FastSortedMap.java.
boolean javolution.util.FastSortedMap< K, V >.remove | ( | Object | key, |
Object | value | ||
) |
Removes the entry for a key only if currently mapped to a given value.
Reimplemented from javolution.util.FastMap< K, V >.
Definition at line 154 of file FastSortedMap.java.
boolean javolution.util.FastSortedMap< K, V >.replace | ( | K | key, |
V | oldValue, | ||
V | newValue | ||
) |
Replaces the entry for a key only if currently mapped to a given value.
Reimplemented from javolution.util.FastMap< K, V >.
Definition at line 160 of file FastSortedMap.java.
V javolution.util.FastSortedMap< K, V >.replace | ( | K | key, |
V | value | ||
) |
Replaces the entry for a key only if currently mapped to some value.
Reimplemented from javolution.util.FastMap< K, V >.
Definition at line 166 of file FastSortedMap.java.
|
inherited |
Returns a sequential view of this collection. Using this view, all closure-based iterations are performed sequentially.
Definition at line 186 of file FastMap.java.
|
protected |
Holds the actual map service implementation.
Reimplemented from javolution.util.FastMap< K, V >.
Definition at line 202 of file FastSortedMap.java.
Referenced by javolution.util.FastSortedMap< K, V >.atomic(), javolution.util.FastSortedMap< K, V >.entrySet(), javolution.util.FastSortedMap< K, V >.FastSortedMap(), javolution.util.FastSortedMap< K, V >.firstKey(), javolution.util.FastSortedMap< K, V >.headMap(), javolution.util.FastSortedMap< K, V >.keySet(), javolution.util.FastSortedMap< K, V >.lastKey(), javolution.util.FastSortedMap< K, V >.shared(), javolution.util.FastSortedMap< K, V >.subMap(), javolution.util.FastSortedMap< K, V >.tailMap(), and javolution.util.FastSortedMap< K, V >.unmodifiable().
FastSortedMap<K, V> javolution.util.FastSortedMap< K, V >.shared | ( | ) |
Returns a thread-safe view over this map. The shared view allows for concurrent read as long as there is no writer. The default implementation is based on readers-writers locks giving priority to writers. Iterators on shared collections are thread-safe (no ConcurrentModificationException possible).
Reimplemented from javolution.util.FastMap< K, V >.
Definition at line 80 of file FastSortedMap.java.
References javolution.util.FastSortedMap< K, V >.service().
|
inherited |
Returns the number of entries/keys/values in this map.
Definition at line 287 of file FastMap.java.
FastSortedMap<K, V> javolution.util.FastSortedMap< K, V >.subMap | ( | K | fromKey, |
K | toKey | ||
) |
Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive.
Definition at line 102 of file FastSortedMap.java.
References javolution.util.FastSortedMap< K, V >.service().
Referenced by javolution.util.FastSortedMap< K, V >.headMap(), and javolution.util.FastSortedMap< K, V >.tailMap().
FastSortedMap<K, V> javolution.util.FastSortedMap< K, V >.tailMap | ( | K | fromKey | ) |
Returns a view of the portion of this map whose keys are greater than or equal to fromKey.
Definition at line 114 of file FastSortedMap.java.
References javolution.util.FastSortedMap< K, V >.lastKey(), javolution.util.FastSortedMap< K, V >.service(), and javolution.util.FastSortedMap< K, V >.subMap().
|
packageinherited |
Returns an immutable reference over this map. The immutable value is an unmodifiable view of this map for which the caller guarantees that no change will ever be made (e.g. there is no reference left to the original map).
Definition at line 398 of file FastMap.java.
|
inherited |
Returns the string representation of this map entries.
Definition at line 413 of file FastMap.java.
FastSortedMap<K, V> javolution.util.FastSortedMap< K, V >.unmodifiable | ( | ) |
Returns an unmodifiable view over this map. Any attempt to modify the map through this view will result into a java.lang.UnsupportedOperationException being raised.
Reimplemented from javolution.util.FastMap< K, V >.
Definition at line 85 of file FastSortedMap.java.
References javolution.util.FastSortedMap< K, V >.service().
|
inherited |
Executes the specified update action on this map. That logic may be performed concurrently on sub-maps if this map is parallel. For atomic maps the update is atomic (either concurrent readers see the full result of the action or nothing).
action | the update action. |
ClassCastException | if the action type is not compatible with this map (e.g. action on sorted map and this is a hash map). |
Definition at line 276 of file FastMap.java.
|
inherited |
Returns a collection 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. The collection supports removing values (hence entries) but not adding new values.
Definition at line 216 of file FastMap.java.
|
staticprivate |
Definition at line 37 of file FastSortedMap.java.