railo.commons.util.mod
Class LinkedHashMapPro<K,V>

java.lang.Object
  extended by railo.commons.util.mod.AbstractMapPro<K,V>
      extended by railo.commons.util.mod.HashMapPro<K,V>
          extended by railo.commons.util.mod.LinkedHashMapPro<K,V>
All Implemented Interfaces:
Externalizable, Serializable, Cloneable, Map<K,V>, MapPro<K,V>

public class LinkedHashMapPro<K,V>
extends HashMapPro<K,V>
implements MapPro<K,V>

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class railo.commons.util.mod.AbstractMapPro
AbstractMapPro.SimpleEntry<K,V>, AbstractMapPro.SimpleImmutableEntry<K,V>
 
Constructor Summary
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.
 
Method Summary
 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)
           
 
Methods inherited from class railo.commons.util.mod.HashMapPro
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, r, r, remove, size, values
 
Methods inherited from class railo.commons.util.mod.AbstractMapPro
equals, invalidKey, toString
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface railo.commons.util.mod.MapPro
r, r
 
Methods inherited from interface java.util.Map
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

LinkedHashMapPro

public LinkedHashMapPro(int initialCapacity,
                        float loadFactor)
Constructs an empty insertion-ordered LinkedHashMap instance with the specified initial capacity and load factor.

Parameters:
initialCapacity - the initial capacity
loadFactor - the load factor
Throws:
IllegalArgumentException - if the initial capacity is negative or the load factor is nonpositive

LinkedHashMapPro

public LinkedHashMapPro(int initialCapacity)
Constructs an empty insertion-ordered LinkedHashMap instance with the specified initial capacity and a default load factor (0.75).

Parameters:
initialCapacity - the initial capacity
Throws:
IllegalArgumentException - if the initial capacity is negative

LinkedHashMapPro

public LinkedHashMapPro()
Constructs an empty insertion-ordered LinkedHashMap instance with the default initial capacity (16) and load factor (0.75).


LinkedHashMapPro

public LinkedHashMapPro(Map<? extends K,? extends V> m)
Constructs an insertion-ordered LinkedHashMap instance with the same mappings as the specified map. The LinkedHashMap instance is created with a default load factor (0.75) and an initial capacity sufficient to hold the mappings in the specified map.

Parameters:
m - the map whose mappings are to be placed in this map
Throws:
NullPointerException - if the specified map is null

LinkedHashMapPro

public LinkedHashMapPro(int initialCapacity,
                        float loadFactor,
                        boolean accessOrder)
Constructs an empty LinkedHashMap instance with the specified initial capacity, load factor and ordering mode.

Parameters:
initialCapacity - the initial capacity
loadFactor - the load factor
accessOrder - the ordering mode - true for access-order, false for insertion-order
Throws:
IllegalArgumentException - if the initial capacity is negative or the load factor is nonpositive
Method Detail

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class AbstractMapPro<K,V>
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class AbstractMapPro<K,V>
Throws:
IOException
ClassNotFoundException

containsValue

public boolean containsValue(Object value)
Returns true if this map maps one or more keys to the specified value.

Specified by:
containsValue in interface Map<K,V>
Overrides:
containsValue in class HashMapPro<K,V>
Parameters:
value - value whose presence in this map is to be tested
Returns:
true if this map maps one or more keys to the specified value

get

public 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.

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.

Specified by:
get in interface Map<K,V>
Overrides:
get in class HashMapPro<K,V>

g

public V g(K key)
    throws PageException
Specified by:
g in interface MapPro<K,V>
Overrides:
g in class HashMapPro<K,V>
Throws:
PageException

g

public V g(K key,
           V defaultValue)
Specified by:
g in interface MapPro<K,V>
Overrides:
g in class HashMapPro<K,V>

clear

public void clear()
Removes all of the mappings from this map. The map will be empty after this call returns.

Specified by:
clear in interface Map<K,V>
Overrides:
clear in class HashMapPro<K,V>


Copyright © 2012 Railo