public interface EconomicMap<K,V> extends UnmodifiableEconomicMap<K,V>
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all of the mappings from this map.
|
static <K,V> EconomicMap<K,V> |
create()
Creates a new map that guarantees insertion order on the key set with the default
Equivalence.DEFAULT comparison strategy for keys. |
static <K,V> EconomicMap<K,V> |
create(Equivalence strategy)
Creates a new map that guarantees insertion order on the key set with the given comparison
strategy for keys.
|
static <K,V> EconomicMap<K,V> |
create(Equivalence strategy,
int initialCapacity)
Creates a new map that guarantees insertion order on the key set and initializes with a
specified capacity.
|
static <K,V> EconomicMap<K,V> |
create(Equivalence strategy,
UnmodifiableEconomicMap<K,V> m)
Creates a new map that guarantees insertion order on the key set and copies all elements from
the specified existing map.
|
static <K,V> EconomicMap<K,V> |
create(int initialCapacity)
Creates a new map that guarantees insertion order on the key set with the default
Equivalence.DEFAULT comparison strategy for keys and initializes with a specified
capacity. |
static <K,V> EconomicMap<K,V> |
create(UnmodifiableEconomicMap<K,V> m)
Creates a new map that guarantees insertion order on the key set with the default
Equivalence.DEFAULT comparison strategy for keys and copies all elements from the
specified existing map. |
MapCursor<K,V> |
getEntries()
Returns a
MapCursor view of the mappings contained in this map. |
V |
put(K key,
V value)
Associates
value with key in this map. |
default void |
putAll(EconomicMap<K,V> other)
Copies all of the mappings from
other to this map. |
default void |
putAll(UnmodifiableEconomicMap<? extends K,? extends V> other)
Copies all of the mappings from
other to this map. |
V |
removeKey(K key)
Removes the mapping for
key from this map if it is present. |
void |
replaceAll(BiFunction<? super K,? super V,? extends V> function)
Replaces each entry's value with the result of invoking
function on that entry until
all entries have been processed or the function throws an exception. |
static <K,V> EconomicMap<K,V> |
wrapMap(Map<K,V> map)
Wraps an existing
Map as an EconomicMap . |
containsKey, get, get, getKeys, getValues, isEmpty, size
V put(K key, V value)
value
with key
in this map. If the map previously contained a
mapping for key
, the old value is replaced by value
.key
, or null
if there was no
mapping for key
.default void putAll(EconomicMap<K,V> other)
other
to this map.default void putAll(UnmodifiableEconomicMap<? extends K,? extends V> other)
other
to this map.void clear()
V removeKey(K key)
key
from this map if it is present. The map will not contain
a mapping for key
once the call returns.key
, or null
if there was no
mapping for key
.MapCursor<K,V> getEntries()
MapCursor
view of the mappings contained in this map.getEntries
in interface UnmodifiableEconomicMap<K,V>
void replaceAll(BiFunction<? super K,? super V,? extends V> function)
function
on that entry until
all entries have been processed or the function throws an exception. Exceptions thrown by the
function are relayed to the caller.static <K,V> EconomicMap<K,V> create()
Equivalence.DEFAULT
comparison strategy for keys.static <K,V> EconomicMap<K,V> create(int initialCapacity)
Equivalence.DEFAULT
comparison strategy for keys and initializes with a specified
capacity.static <K,V> EconomicMap<K,V> create(Equivalence strategy)
static <K,V> EconomicMap<K,V> create(UnmodifiableEconomicMap<K,V> m)
Equivalence.DEFAULT
comparison strategy for keys and copies all elements from the
specified existing map.static <K,V> EconomicMap<K,V> create(Equivalence strategy, UnmodifiableEconomicMap<K,V> m)
static <K,V> EconomicMap<K,V> create(Equivalence strategy, int initialCapacity)
static <K,V> EconomicMap<K,V> wrapMap(Map<K,V> map)
Map
as an EconomicMap
.