Package org.jppf.utils.collections
Class LinkedListSortedMap<K,V>
java.lang.Object
org.jppf.utils.collections.AbstractCollectionMap<K,V>
org.jppf.utils.collections.AbstractCollectionSortedMap<K,V>
org.jppf.utils.collections.LinkedListSortedMap<K,V>
- Type Parameters:
K- the type of keys in the map.V- the type of values in the collections mapped to the keys.
- All Implemented Interfaces:
Serializable,Iterable<V>,CollectionMap<K,,V> CollectionSortedMap<K,V>
A sorted map whose values are linked lists of a given component type.
- Author:
- Laurent Cohen
- See Also:
-
Field Summary
Fields inherited from class org.jppf.utils.collections.AbstractCollectionSortedMap
comparatorFields inherited from class org.jppf.utils.collections.AbstractCollectionMap
map -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.LinkedListSortedMap(Comparator<K> comparator) Initialize this collection sorted map with the specified comparator. -
Method Summary
Modifier and TypeMethodDescriptionvoidmoveToEndOfList(K key, V value) Look up the specified value in thel ist corresponding to the specified key and move it to then end of the list.protected Collection<V>Create a new collection of values for insertion into the map.Methods inherited from class org.jppf.utils.collections.AbstractCollectionSortedMap
createMap, firstKey, lastKeyMethods inherited from class org.jppf.utils.collections.AbstractCollectionMap
addValues, addValues, allValues, clear, containsKey, containsValue, containsValue, createOrGetCollection, createOrGetCollectionSynchronized, entrySet, getValues, isEmpty, iterator, iterator, keySet, putValue, removeKey, removeValue, removeValues, size, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jppf.utils.collections.CollectionMap
addValues, addValues, allValues, clear, containsKey, containsValue, containsValue, entrySet, forEach, getValues, isEmpty, iterator, keySet, putValue, removeKey, removeValue, removeValues, sizeMethods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Constructor Details
-
LinkedListSortedMap
public LinkedListSortedMap()Default constructor. -
LinkedListSortedMap
Initialize this collection sorted map with the specified comparator.- Parameters:
comparator- comparator used to sort the keys.
-
-
Method Details
-
newCollection
Description copied from class:AbstractCollectionMapCreate a new collection of values for insertion into the map.- Specified by:
newCollectionin classAbstractCollectionMap<K,V> - Returns:
- a new mutable empty collection.
-
moveToEndOfList
Look up the specified value in thel ist corresponding to the specified key and move it to then end of the list.- Parameters:
key- the key for which to look up in the corresponding list.value- the value to look up.
-