java.lang.Object | +--org.apache.commons.collections.SequencedHashMapAll Implemented Interfaces:
org.apache.commons.collections.map.LinkedMap
org.apache.commons.collections.map.ListOrderedMap
Construct a new sequenced hash map with default initial size and load factor. |
SequencedHashMap(int initialSize) Construct a new sequenced hash map with the specified initial size and default load factor. |
SequencedHashMap(int initialSize, float loadFactor) Construct a new sequenced hash map with the specified initial size and load factor. |
SequencedHashMap(Map m) Construct a new sequenced hash map and add all the elements in the specified map. |
void | clear() Implements Map#clear(). |
Object | clone() Creates a shallow copy of this object, preserving the internal structure by copying only references. |
boolean | containsKey(Object key) Implements Map#containsKey(Object). |
boolean | containsValue(Object value) Implements Map#containsValue(Object). |
Set | entrySet() Implements Map#entrySet(). |
boolean | equals(Object obj) Implements Map#equals(Object). |
Object | get(Object o) Implements Map#get(Object). |
Object | get(int index) Gets the key at the specified index. |
Map.Entry | getFirst() Return the entry for the "oldest" mapping. |
Object | Return the key for the "oldest" mapping. |
Object | Return the value for the "oldest" mapping. |
Map.Entry | getLast() Return the entry for the "newest" mapping. |
Object | Return the key for the "newest" mapping. |
Object | Return the value for the "newest" mapping. |
Object | getValue(int index) Gets the value at the specified index. |
int | hashCode() Implements Map#hashCode(). |
int | indexOf(Object key) Gets the index of the specified key. |
boolean | isEmpty() Implements Map#isEmpty(). |
Iterator | iterator() Gets an iterator over the keys. |
Set | keySet() Implements Map#keySet(). |
int | lastIndexOf(Object key) Gets the last index of the specified key. |
Object | put(Object key, Object value) Implements Map#put(Object, Object). |
void | putAll(Map t) Adds all the mappings in the specified map to this map, replacing any mappings that already exist (as per Map#putAll(Map)). |
void | readExternal(ObjectInput in) Deserializes this map from the given stream. |
Object | remove(Object key) Implements Map#remove(Object). |
Object | remove(int index) Removes the element at the specified index. |
List | sequence() Returns a List view of the keys rather than a set view. |
int | size() Implements Map#size(). |
String | toString() Provides a string representation of the entries within the map. |
Collection | values() Implements Map#values(). |
void | writeExternal(ObjectOutput out) Serializes this map to the given stream. |
public SequencedHashMap()
public SequencedHashMap(int initialSize, float loadFactor)
HashMap.HashMap(int,float)
public SequencedHashMap(int initialSize)
HashMap.HashMap(int)
public SequencedHashMap(Map m)
public void clear()
public Object clone()
clone()
'd. The cloned object maintains the same sequence.
- if clone is not supported by a
subclass.public boolean containsKey(Object key)
public boolean containsValue(Object value)
public Set entrySet()
public boolean equals(Object obj)
public Object get(int index)
- if the index is
< 0 or > the size of the map.public Object get(Object o)
public Entry getFirst()
entrySet().iterator().next()
, but this method provides an
optimized implementation.
public Object getFirstKey()
getFirst().getKey()
, but this method provides a slightly
optimized implementation.
public Object getFirstValue()
getFirst().getValue()
, but this method provides a slightly
optimized implementation.
public Entry getLast()
Object obj = null; Iterator iter = entrySet().iterator(); while(iter.hasNext()) { obj = iter.next(); } return (Map.Entry)objHowever, the implementation of this method ensures an O(1) lookup of the last key rather than O(n).
public Object getLastKey()
getLast().getKey()
, but this method provides a slightly
optimized implementation.
public Object getLastValue()
getLast().getValue()
, but this method provides a slightly
optimized implementation.
public Object getValue(int index)
- if the index is
< 0 or > the size of the map.public int hashCode()
public int indexOf(Object key)
public boolean isEmpty()
public Iterator iterator()
public Set keySet()
public int lastIndexOf(Object key)
public Object put(Object key, Object value)
public void putAll(Map t)
- if t is nullpublic void readExternal(ObjectInput in)
- if the stream raises it
- if the stream raises itpublic Object remove(int index)
- if the index is
< 0 or > the size of the map.public Object remove(Object key)
public List sequence()
keySet()
public int size()
public String toString()
public Collection values()
public void writeExternal(ObjectOutput out)
- if the stream raises it