Package icyllis.modernui.lifecycle
Class SafeLinkedHashMap<T,E extends Supplier<T>>
java.lang.Object
icyllis.modernui.lifecycle.SafeLinkedList<T,E>
icyllis.modernui.lifecycle.SafeLinkedHashMap<T,E>
- Type Parameters:
T
- the token typeE
- the element type, which is associated with the token
- All Implemented Interfaces:
Iterable<E>
LinkedHashMap, which supports modifications during iterations.
Takes more memory that
SafeLinkedList
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn an element added to prior to an element associated with the given token.boolean
Returnstrue
if this map contains a mapping for the specified token.protected icyllis.modernui.lifecycle.SafeLinkedList.Node
<E> putIfAbsent
(E e) If the specified key is not already associated with a value, associates it with the given value.Removes the mapping for a key from this map if it is present.Methods inherited from class icyllis.modernui.lifecycle.SafeLinkedList
descendingIterator, equals, hashCode, head, iterator, iteratorWithAdditions, put, size, tail, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
SafeLinkedHashMap
public SafeLinkedHashMap()
-
-
Method Details
-
find
-
putIfAbsent
Description copied from class:SafeLinkedList
If the specified key is not already associated with a value, associates it with the given value.- Overrides:
putIfAbsent
in classSafeLinkedList<T,
E extends Supplier<T>> - Parameters:
e
- value to be associated with the specified key- Returns:
- the previous value associated with the specified key,
or
null
if there was no mapping for the key
-
remove
Description copied from class:SafeLinkedList
Removes the mapping for a key from this map if it is present. -
contains
Returnstrue
if this map contains a mapping for the specified token. -
ceil
Return an element added to prior to an element associated with the given token.- Parameters:
token
- the token
-