public class ExtMap extends Object implements ConcurrentMap<ExtKey,Object>, Cloneable, Serializable
| Constructor and Description |
|---|
ExtMap()
Constructs an empty ExtMap with the default initial capacity (16) and the default load factor (0.75).
|
ExtMap(int initialCapacity)
Constructs an empty ExtMap with the specified initial capacity and the default load factor (0.75).
|
ExtMap(int initialCapacity,
float loadFactor)
Constructs an empty ExtMap with the specified initial capacity and load factor.
|
ExtMap(Map<ExtKey,Object> m)
Constructs a new ExtMap with the same mappings as the specified Map.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
ExtMap |
clone() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<ExtKey,Object>> |
entrySet() |
boolean |
equals(Object obj) |
<T> T |
get(ExtKey key)
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
|
<T> T |
get(ExtKey key,
Class<T> type)
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
|
<T> T |
get(ExtKey key,
Class<T> type,
T defaultValue)
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
|
<T> T |
get(ExtKey key,
Object defaultValue)
Returns the value to which the specified key is mapped, or default.
|
Object |
get(Object key) |
int |
hashCode() |
boolean |
isEmpty() |
Set<ExtKey> |
keySet() |
ExtMap |
mput(ExtKey key,
Object value)
Multiple put.
|
ExtMap |
mput(Map<? extends ExtKey,? extends Object> m)
Multiple putAll.
|
Object |
put(ExtKey key,
Object value) |
void |
putAll(Map<? extends ExtKey,? extends Object> m) |
Object |
putIfAbsent(ExtKey key,
Object value) |
Object |
remove(Object key) |
boolean |
remove(Object key,
Object value) |
Object |
replace(ExtKey key,
Object value) |
boolean |
replace(ExtKey key,
Object oldValue,
Object newValue) |
int |
size() |
String |
toString() |
Collection<Object> |
values() |
finalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAllpublic ExtMap(int initialCapacity,
float loadFactor)
initialCapacity - the initial capacity.loadFactor - the load factor.IllegalArgumentException - if the initial capacity is negative or the load factor is nonpositive.public ExtMap(int initialCapacity)
initialCapacity - the initial capacity.IllegalArgumentException - if the initial capacity is negative or the load factor is nonpositive.public ExtMap()
public ExtMap(Map<ExtKey,Object> m)
m - the map whose mappings are to be placed in this map.NullPointerException - if the specified map is null.public boolean equals(Object obj)
public int hashCode()
public boolean containsKey(Object key)
containsKey in interface Map<ExtKey,Object>public boolean containsValue(Object value)
containsValue in interface Map<ExtKey,Object>public Object putIfAbsent(ExtKey key, Object value)
putIfAbsent in interface ConcurrentMap<ExtKey,Object>putIfAbsent in interface Map<ExtKey,Object>public ExtMap mput(ExtKey key, Object value)
ExtMap = new ExtMap().mput(key1, value1).mput(key2, value2);
key - key with which the specified value is to be associated.value - value to be associated with the specified key.public ExtMap mput(Map<? extends ExtKey,? extends Object> m)
ExtMap = new ExtMap().mputAll(map1).mputAll(map2);
m - map to add.public <T> T get(ExtKey key, Class<T> type, T defaultValue)
Integer i = <Integer> map.get(key1, Integer);
T - type of return and default value, inferredkey - key with which the specified value is to be associated.type - expected type.defaultValue - default value to return.public <T> T get(ExtKey key, Class<T> type)
T - type of return value, inferredkey - key with which the specified value is to be associated.type - expected type.get(ExtKey key, Class type, Object defaultValue)public <T> T get(ExtKey key)
Integer i = <Integer> map.get(key1);
T - type of return valuekey - key.public <T> T get(ExtKey key, Object defaultValue)
Integer i = <Integer> map.get(key1, 5);
T - type of return and default value, inferredkey - key.defaultValue - default value.Copyright © 2019. All rights reserved.