public class LinkedHashMapPro<K,V> extends HashMapPro<K,V> implements MapPro<K,V>
AbstractMapPro.SimpleEntry<K,V>, AbstractMapPro.SimpleImmutableEntry<K,V>
DEFAULT_INITIAL_CAPACITY
Constructor and Description |
---|
LinkedHashMapPro()
Constructs an empty insertion-ordered LinkedHashMap instance
with the default initial capacity (16) and load factor (0.75).
|
LinkedHashMapPro(int initialCapacity)
Constructs an empty insertion-ordered LinkedHashMap instance
with the specified initial capacity and a default load factor (0.75).
|
LinkedHashMapPro(int initialCapacity,
float loadFactor)
Constructs an empty insertion-ordered LinkedHashMap instance
with the specified initial capacity and load factor.
|
LinkedHashMapPro(int initialCapacity,
float loadFactor,
boolean accessOrder)
Constructs an empty LinkedHashMap instance with the
specified initial capacity, load factor and ordering mode.
|
LinkedHashMapPro(Map<? extends K,? extends V> m)
Constructs an insertion-ordered LinkedHashMap instance with
the same mappings as the specified map.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all of the mappings from this map.
|
boolean |
containsValue(Object value)
Returns true if this map maps one or more keys to the
specified value.
|
V |
g(K key) |
V |
g(K key,
V defaultValue) |
V |
get(Object key)
Returns the value to which the specified key is mapped,
or
null if this map contains no mapping for the key. |
void |
readExternal(ObjectInput in) |
void |
writeExternal(ObjectOutput out) |
clone, containsKey, entrySet, isEmpty, keySet, main, put, putAll, r, r, remove, size, values
equals, invalidKey, toString
public LinkedHashMapPro(int initialCapacity, float loadFactor)
initialCapacity
- the initial capacityloadFactor
- the load factorIllegalArgumentException
- if the initial capacity is negative
or the load factor is nonpositivepublic LinkedHashMapPro(int initialCapacity)
initialCapacity
- the initial capacityIllegalArgumentException
- if the initial capacity is negativepublic LinkedHashMapPro()
public LinkedHashMapPro(Map<? extends K,? extends V> m)
m
- the map whose mappings are to be placed in this mapNullPointerException
- if the specified map is nullpublic LinkedHashMapPro(int initialCapacity, float loadFactor, boolean accessOrder)
initialCapacity
- the initial capacityloadFactor
- the load factoraccessOrder
- the ordering mode - true for
access-order, false for insertion-orderIllegalArgumentException
- if the initial capacity is negative
or the load factor is nonpositivepublic void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class AbstractMapPro<K,V>
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class AbstractMapPro<K,V>
IOException
ClassNotFoundException
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
containsValue
in class HashMapPro<K,V>
value
- value whose presence in this map is to be testedpublic V get(Object key)
null
if this map contains no mapping for the key.
More formally, if this map contains a mapping from a key
k
to a value v
such that (key==null ? k==null :
key.equals(k))
, then this method returns v
; otherwise
it returns null
. (There can be at most one such mapping.)
A return value of null
does not necessarily
indicate that the map contains no mapping for the key; it's also
possible that the map explicitly maps the key to null
.
The containsKey
operation may be used to
distinguish these two cases.
public V g(K key) throws PageException
g
in interface MapPro<K,V>
g
in class HashMapPro<K,V>
PageException
Copyright © 2015 Lucee