Class AbstractLinkedMap
- java.lang.Object
 - 
- java.util.AbstractMap
 - 
- org.apache.commons.collections.map.AbstractHashedMap
 - 
- org.apache.commons.collections.map.AbstractLinkedMap
 
 
 
 
- 
- All Implemented Interfaces:
 java.util.Map,IterableMap,OrderedMap
@Deprecated(since="2021-04-30") public class AbstractLinkedMap extends AbstractHashedMap implements OrderedMap
Deprecated.Commons Collections 3 is in maintenance mode. Commons Collections 4 should be used instead.An abstract implementation of a hash-based map that links entries to create an ordered map and which provides numerous points for subclasses to override.This class implements all the features necessary for a subclass linked hash-based map. Key-value entries are stored in instances of the
LinkEntryclass which can be overridden and replaced. The iterators can similarly be replaced, without the need to replace the KeySet, EntrySet and Values view classes.Overridable methods are provided to change the default hashing behaviour, and to change how entries are added to and removed from the map. Hopefully, all you need for unusual subclasses is here.
This implementation maintains order by original insertion, but subclasses may work differently. The
OrderedMapinterface is implemented to provide access to bidirectional iteration and extra convenience methods.The
orderedMapIterator()method provides direct access to a bidirectional iterator. The iterators from the other views can also be cast toOrderedIteratorif required.All the available iterators can be reset back to the start by casting to
ResettableIteratorand callingreset().The implementation is also designed to be subclassed, with lots of useful methods exposed.
- Since:
 - Commons Collections 3.0
 
 
- 
- 
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclear()Deprecated.Clears the map, resetting the size to zero and nullifying references to avoid garbage collection issues.booleancontainsValue(java.lang.Object value)Deprecated.Checks whether the map contains the specified value.java.lang.ObjectfirstKey()Deprecated.Gets the first key in the map, which is the most recently inserted.java.lang.ObjectlastKey()Deprecated.Gets the last key in the map, which is the first inserted.MapIteratormapIterator()Deprecated.Gets an iterator over the map.java.lang.ObjectnextKey(java.lang.Object key)Deprecated.Gets the next key in sequence.OrderedMapIteratororderedMapIterator()Deprecated.Gets a bidirectional iterator over the map.java.lang.ObjectpreviousKey(java.lang.Object key)Deprecated.Gets the previous key in sequence. 
 - 
 
- 
- 
Method Detail
- 
containsValue
public boolean containsValue(java.lang.Object value)
Deprecated.Checks whether the map contains the specified value.- Specified by:
 containsValuein interfacejava.util.Map- Overrides:
 containsValuein classAbstractHashedMap- Parameters:
 value- the value to search for- Returns:
 - true if the map contains the value
 
 
- 
clear
public void clear()
Deprecated.Clears the map, resetting the size to zero and nullifying references to avoid garbage collection issues.- Specified by:
 clearin interfacejava.util.Map- Overrides:
 clearin classAbstractHashedMap
 
- 
firstKey
public java.lang.Object firstKey()
Deprecated.Gets the first key in the map, which is the most recently inserted.- Specified by:
 firstKeyin interfaceOrderedMap- Returns:
 - the most recently inserted key
 
 
- 
lastKey
public java.lang.Object lastKey()
Deprecated.Gets the last key in the map, which is the first inserted.- Specified by:
 lastKeyin interfaceOrderedMap- Returns:
 - the eldest key
 
 
- 
nextKey
public java.lang.Object nextKey(java.lang.Object key)
Deprecated.Gets the next key in sequence.- Specified by:
 nextKeyin interfaceOrderedMap- Parameters:
 key- the key to get after- Returns:
 - the next key
 
 
- 
previousKey
public java.lang.Object previousKey(java.lang.Object key)
Deprecated.Gets the previous key in sequence.- Specified by:
 previousKeyin interfaceOrderedMap- Parameters:
 key- the key to get before- Returns:
 - the previous key
 
 
- 
mapIterator
public MapIterator mapIterator()
Deprecated.Gets an iterator over the map. Changes made to the iterator affect this map.A MapIterator returns the keys in the map. It also provides convenient methods to get the key and value, and set the value. It avoids the need to create an entrySet/keySet/values object.
- Specified by:
 mapIteratorin interfaceIterableMap- Overrides:
 mapIteratorin classAbstractHashedMap- Returns:
 - the map iterator
 
 
- 
orderedMapIterator
public OrderedMapIterator orderedMapIterator()
Deprecated.Gets a bidirectional iterator over the map. Changes made to the iterator affect this map.A MapIterator returns the keys in the map. It also provides convenient methods to get the key and value, and set the value. It avoids the need to create an entrySet/keySet/values object.
- Specified by:
 orderedMapIteratorin interfaceOrderedMap- Returns:
 - the map iterator
 
 
 - 
 
 -