|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.ws.rs.core.AbstractMultivaluedMap<K,V> javax.ws.rs.core.MultivaluedHashMap<K,V>
K
- the type of keys maintained by this map.V
- the type of mapped values.public class MultivaluedHashMap<K,V>
A hash table based implementation of MultivaluedMap
interface.
This implementation provides all of the optional map operations. This class
makes no guarantees as to the order of the map; in particular, it does not
guarantee that the order will remain constant over time. The implementation
permits null
key. By default the implementation does also permit
null
values, but ignores them. This behavior can be customized
by overriding the protected addNull(...)
and
addFirstNull(...)
methods.
ConcurrentModificationException
.
Thus, in the face of concurrent modification, the iterator fails quickly and
cleanly, rather than risking arbitrary, non-deterministic behavior at an
undetermined time in the future.
Note that the fail-fast behavior of an iterator cannot be guaranteed
as it is, generally speaking, impossible to make any hard guarantees in the
presence of unsynchronized concurrent modification. Fail-fast iterators
throw ConcurrentModificationException on a best-effort basis.
Therefore, it would be wrong to write a program that depended on this
exception for its correctness: the fail-fast behavior of iterators
should be used only to detect bugs.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Field Summary |
---|
Fields inherited from class javax.ws.rs.core.AbstractMultivaluedMap |
---|
store |
Constructor Summary | |
---|---|
MultivaluedHashMap()
Constructs an empty multivalued hash map with the default initial capacity ( 16 ) and the default load factor (0.75 ). |
|
MultivaluedHashMap(int initialCapacity)
Constructs an empty multivalued hash map with the specified initial capacity and the default load factor ( 0.75 ). |
|
MultivaluedHashMap(int initialCapacity,
float loadFactor)
Constructs an empty multivalued hash map with the specified initial capacity and load factor. |
|
MultivaluedHashMap(java.util.Map<? extends K,? extends V> map)
Constructs a new multivalued hash map with the same mappings as the specified single-valued Map . |
|
MultivaluedHashMap(MultivaluedMap<? extends K,? extends V> map)
Constructs a new multivalued hash map with the same mappings as the specified MultivaluedMap . |
Method Summary |
---|
Methods inherited from class javax.ws.rs.core.AbstractMultivaluedMap |
---|
add, addAll, addAll, addFirst, addFirstNull, addNull, clear, containsKey, containsValue, entrySet, equals, equalsIgnoreValueOrder, get, getFirst, getValues, hashCode, isEmpty, keySet, put, putAll, putSingle, remove, size, toString, values |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MultivaluedHashMap()
16
) and the default load factor (0.75
).
public MultivaluedHashMap(int initialCapacity)
0.75
).
initialCapacity
- the initial capacity.
java.lang.IllegalArgumentException
- if the initial capacity is negative.public MultivaluedHashMap(int initialCapacity, float loadFactor)
initialCapacity
- the initial capacityloadFactor
- the load factor
java.lang.IllegalArgumentException
- if the initial capacity is negative
or the load factor is nonpositivepublic MultivaluedHashMap(MultivaluedMap<? extends K,? extends V> map)
MultivaluedMap
. The List
instances holding
the values of each key are created anew instead of being reused.
map
- the multivalued map whose mappings are to be placed in this
multivalued map.
java.lang.NullPointerException
- if the specified map is null
public MultivaluedHashMap(java.util.Map<? extends K,? extends V> map)
Map
.
map
- the single-valued map whose mappings are to be placed in this
multivalued map.
java.lang.NullPointerException
- if the specified map is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |