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 type
E - the element type, which is associated with the token
All Implemented Interfaces:
Iterable<E>

public class SafeLinkedHashMap<T,E extends Supplier<T>> extends SafeLinkedList<T,E>
LinkedHashMap, which supports modifications during iterations. Takes more memory that SafeLinkedList.
  • Constructor Details

    • SafeLinkedHashMap

      public SafeLinkedHashMap()
  • Method Details

    • find

      protected icyllis.modernui.lifecycle.SafeLinkedList.Node<E> find(T token)
      Overrides:
      find in class SafeLinkedList<T,E extends Supplier<T>>
    • putIfAbsent

      public E putIfAbsent(@Nonnull E e)
      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 class SafeLinkedList<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

      public E remove(@Nonnull T token)
      Description copied from class: SafeLinkedList
      Removes the mapping for a key from this map if it is present.
      Overrides:
      remove in class SafeLinkedList<T,E extends Supplier<T>>
      Parameters:
      token - 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
    • contains

      public boolean contains(@Nonnull T token)
      Returns true if this map contains a mapping for the specified token.
    • ceil

      @Nullable public E ceil(T token)
      Return an element added to prior to an element associated with the given token.
      Parameters:
      token - the token