| java.lang.Object org.codehaus.aspectwerkz.util.SequencedHashMap
Constructor Summary | |
public | SequencedHashMap() Construct a new sequenced hash map with default initial size and load factor. | public | SequencedHashMap(int initialSize) Construct a new sequenced hash map with the specified initial size and default load factor. | public | SequencedHashMap(int initialSize, float loadFactor) Construct a new sequenced hash map with the specified initial size and load factor. | public | SequencedHashMap(Map m) Construct a new sequenced hash map and add all the elements in the specified map. |
SequencedHashMap | public SequencedHashMap()(Code) | | Construct a new sequenced hash map with default initial size and load factor.
|
SequencedHashMap | public SequencedHashMap(int initialSize)(Code) | | Construct a new sequenced hash map with the specified initial size and default load factor.
Parameters: initialSize - the initial size for the hash table See Also: HashMap.HashMap(int) |
SequencedHashMap | public SequencedHashMap(int initialSize, float loadFactor)(Code) | | Construct a new sequenced hash map with the specified initial size and load factor.
Parameters: initialSize - the initial size for the hash table Parameters: loadFactor - the load factor for the hash table. See Also: HashMap.HashMap(intfloat) |
SequencedHashMap | public SequencedHashMap(Map m)(Code) | | Construct a new sequenced hash map and add all the elements in the specified map. The order in which the mappings
in the specified map are added is defined by
SequencedHashMap.putAll(Map) .
|
clone | public Object clone() throws CloneNotSupportedException(Code) | | Creates a shallow copy of this object, preserving the internal structure by copying only references. The keys and
values themselves are not clone() 'd. The cloned object maintains the same sequence.
A clone of this instance. throws: CloneNotSupportedException - if clone is not supported by a subclass. |
getFirst | public Map.Entry getFirst()(Code) | | Return the entry for the "oldest" mapping. That is, return the Map.Entry for the key-value pair that was first
put into the map when compared to all the other pairings in the map. This behavior is equivalent to using
entrySet().iterator().next() , but this method provides an optimized implementation.
The first entry in the sequence, or null if the map is empty. |
getFirstKey | public Object getFirstKey()(Code) | | Return the key for the "oldest" mapping. That is, return the key for the mapping that was first put into the map
when compared to all the other objects in the map. This behavior is equivalent to using
getFirst().getKey() , but this method provides a slightly optimized implementation.
The first key in the sequence, or null if the map is empty. |
getFirstValue | public Object getFirstValue()(Code) | | Return the value for the "oldest" mapping. That is, return the value for the mapping that was first put into the
map when compared to all the other objects in the map. This behavior is equivalent to using
getFirst().getValue() , but this method provides a slightly optimized implementation.
The first value in the sequence, or null if the map is empty. |
getLast | public Map.Entry getLast()(Code) | | Return the entry for the "newest" mapping. That is, return the Map.Entry for the key-value pair that was first
put into the map when compared to all the other pairings in the map. The behavior is equivalent to:
Object obj = null;
Iterator iter = entrySet().iterator();
while (iter.hasNext()) {
obj = iter.next();
}
return (Map.Entry) obj;
However, the implementation of this method ensures an O(1) lookup of the last key rather than O(n).
The last entry in the sequence, or null if the map is empty. |
getLastKey | public Object getLastKey()(Code) | | Return the key for the "newest" mapping. That is, return the key for the mapping that was last put into the map
when compared to all the other objects in the map. This behavior is equivalent to using
getLast().getKey() , but this method provides a slightly optimized implementation.
The last key in the sequence, or null if the map is empty. |
getLastValue | public Object getLastValue()(Code) | | Return the value for the "newest" mapping. That is, return the value for the mapping that was last put into the
map when compared to all the other objects in the map. This behavior is equivalent to using
getLast().getValue() , but this method provides a slightly optimized implementation.
The last value in the sequence, or null if the map is empty. |
indexOf | public int indexOf(Object key)(Code) | | Returns the index of the specified key.
|
lastIndexOf | public int lastIndexOf(Object key)(Code) | | Returns the last index of the specified key.
|
putAll | public void putAll(Map t)(Code) | | Adds all the mappings in the specified map to this map, replacing any mappings that already exist (as per
). The order in which the entries are added is determined by the iterator returned from
for the specified map.
Parameters: t - the mappings that should be added to this map. throws: NullPointerException - if t is null |
remove | public Object remove(int index)(Code) | | Removes the element at the specified index.
Parameters: index - The index of the object to remove. The previous value coressponding the key , or null if none existed. throws: ArrayIndexOutOfBoundsException - if the index is < 0 or > the size of the map. |
sequence | public List sequence()(Code) | | Returns a List view of the keys rather than a set view. The returned list is unmodifiable. This is required
because changes to the values of the list (using
java.util.ListIterator.set(Object) ) will effectively
remove the value from the list and reinsert that value at the end of the list, which is an unexpected side effect
of changing the value of a list. This occurs because changing the key, changes when the mapping is added to the
map and thus where it appears in the list.
An alternative to this method is to use
SequencedHashMap.keySet() The ordered list of keys. See Also: SequencedHashMap.keySet() |
toString | public String toString()(Code) | | Provides a string representation of the entries within the map. The format of the returned string may change with
different releases, so this method is suitable for debugging purposes only. If a specific format is required, use
SequencedHashMap.entrySet() .
Set.iterator iterator() and iterate over the entries in the map formatting them
as appropriate.
|
writeExternal | public void writeExternal(ObjectOutput out) throws IOException(Code) | | Serializes this map to the given stream.
Parameters: out - the stream to serialize to throws: IOException - if the stream raises it |
|
|