Package icyllis.modernui.lifecycle
Class SafeLinkedList<T,E extends Supplier<T>>
java.lang.Object
icyllis.modernui.lifecycle.SafeLinkedList<T,E>
- Type Parameters:
T
- the token typeE
- the element type, which is associated with the token
- All Implemented Interfaces:
Iterable<E>
- Direct Known Subclasses:
SafeLinkedHashMap
LinkedList, which pretends to be a map and supports modifications during iterations.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
protected icyllis.modernui.lifecycle.SafeLinkedList.Node
<E> int
hashCode()
head()
iterator()
return an iterator with additions.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.int
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
-
SafeLinkedList
public SafeLinkedList()
-
-
Method Details
-
find
-
putIfAbsent
If the specified key is not already associated with a value, associates it with the given value.- 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
-
put
-
remove
Removes the mapping for a key from this map if it is present.- Parameters:
key
- key whose mapping is to be removed from the map- Returns:
- the previous value associated with the specified key,
or
null
if there was no mapping for the key
-
size
public int size()- Returns:
- the number of elements in this map
-
iterator
-
descendingIterator
- Returns:
- a descending iterator, which doesn't include new elements added during an iteration.
-
iteratorWithAdditions
return an iterator with additions. -
head
- Returns:
- eldest added or null
-
tail
- Returns:
- newest added or null
-
equals
-
hashCode
public int hashCode() -
toString
-