Top Inners Fields Constructors Methods
com.thoughtworks.xstream.core.util

public Class OrderRetainingMap

extends HashMap
Class Inheritance
Imports
java.util.ArrayList, .Arrays, .Collection, .Collections, .HashMap, .Iterator, .List, .Map, .Set

Deprecated

As of 1.4.8 use java.util.LinkedHashMap

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private OrderRetainingMap.ArraySet
private List<E>

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Overrides java.util.HashMap.clear.

Implements java.util.Map.clear.

Removes all of the mappings from this map.
public Set<E>
entrySet()

Overrides java.util.HashMap.entrySet.

Implements java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map.
public Set<E>
keySet()

Overrides java.util.HashMap.keySet.

Implements java.util.Map.keySet.

Returns a Set view of the keys contained in this map.
public Object
put(Object
key with which the specified value is to be associated
key
,
Object
value to be associated with the specified key
value
)

Overrides java.util.HashMap.put.

Implements java.util.Map.put.

Associates the specified value with the specified key in this map.
public void
putAll(Map<K, V>
mappings to be stored in this map
m
)

Overrides java.util.HashMap.putAll.

Implements java.util.Map.putAll.

Copies all of the mappings from the specified map to this map.
public Object
remove(Object
key whose mapping is to be removed from the map
key
)

Overrides java.util.HashMap.remove.

Implements java.util.Map.remove.

Removes the mapping for the specified key from this map if present.
public Collection<E>
values()

Overrides java.util.HashMap.values.

Implements java.util.Map.values.

Returns a Collection view of the values contained in this map.
Inherited from java.util.HashMap:
clonecomputecomputeIfAbsentcomputeIfPresentcontainsKeycontainsValueforEachgetgetOrDefaultisEmptymergenewHashMapputIfAbsentremovereplacereplacereplaceAllsize

Field Detail

keyOrderback to summary
private OrderRetainingMap.ArraySet keyOrder
valueOrderback to summary
private List<E> valueOrder

Constructor Detail

OrderRetainingMapback to summary
public OrderRetainingMap()
OrderRetainingMapback to summary
public OrderRetainingMap(Map<K, V> m)

Method Detail

clearback to summary
public void clear()

Overrides java.util.HashMap.clear.

Implements java.util.Map.clear.

Doc from java.util.HashMap.clear.

Removes all of the mappings from this map. The map will be empty after this call returns.

entrySetback to summary
public Set<E> entrySet()

Overrides java.util.HashMap.entrySet.

Implements java.util.Map.entrySet.

Doc from java.util.HashMap.entrySet.

Returns a Set view of the mappings contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Returns:Set<E>

a set view of the mappings contained in this map

keySetback to summary
public Set<E> keySet()

Overrides java.util.HashMap.keySet.

Implements java.util.Map.keySet.

Doc from java.util.HashMap.keySet.

Returns a Set view of the keys contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations.

Returns:Set<E>

a set view of the keys contained in this map

putback to summary
public Object put(Object key, Object value)

Overrides java.util.HashMap.put.

Implements java.util.Map.put.

Doc from java.util.HashMap.put.

Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced.

Parameters
key:Object

key with which the specified value is to be associated

value:Object

value to be associated with the specified key

Returns:Object

the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key.)

putAllback to summary
public void putAll(Map<K, V> m)

Overrides java.util.HashMap.putAll.

Implements java.util.Map.putAll.

Doc from java.util.HashMap.putAll.

Copies all of the mappings from the specified map to this map. These mappings will replace any mappings that this map had for any of the keys currently in the specified map.

Parameters
m:Map<K, V>

mappings to be stored in this map

removeback to summary
public Object remove(Object key)

Overrides java.util.HashMap.remove.

Implements java.util.Map.remove.

Doc from java.util.HashMap.remove.

Removes the mapping for the specified key from this map if present.

Parameters
key:Object

key whose mapping is to be removed from the map

Returns:Object

the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key.)

valuesback to summary
public Collection<E> values()

Overrides java.util.HashMap.values.

Implements java.util.Map.values.

Doc from java.util.HashMap.values.

Returns a Collection view of the values contained in this map. The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. If the map is modified while an iteration over the collection is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The collection supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Collection.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Returns:Collection<E>

a view of the values contained in this map

com.thoughtworks.xstream.core.util back to summary

private Class OrderRetainingMap.ArraySet

extends ArrayList
implements Set
Class Inheritance
All Implemented Interfaces
java.util.Set, java.util.Collection, java.lang.Iterable

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.util.ArrayList:
addaddaddAlladdAlladdFirstaddLastclearclonecontainsensureCapacityequalsforEachgetgetFirstgetLasthashCodeindexOfisEmptyiteratorlastIndexOflistIteratorlistIteratorremoveremoveremoveAllremoveFirstremoveIfremoveLastremoveRangereplaceAllretainAllsetsizesortspliteratorsubListtoArraytoArraytrimToSize

Constructor Detail

ArraySetback to summary
private ArraySet()