类 MutableHashedLinkedMap<K,V>

java.lang.Object
net.minecraftforge.common.util.MutableHashedLinkedMap<K,V>
类型参数:
K - the type of keys
V - the type of mapped values
所有已实现的接口:
Iterable<Map.Entry<K,V>>

public class MutableHashedLinkedMap<K,V> extends Object implements Iterable<Map.Entry<K,V>>
A mutable linked map with a hashing strategy and a merge function.
  • 字段详细资料

  • 构造器详细资料

    • MutableHashedLinkedMap

      public MutableHashedLinkedMap()
      Creates a new instance using the BASIC strategy.
    • MutableHashedLinkedMap

      public MutableHashedLinkedMap(it.unimi.dsi.fastutil.Hash.Strategy<? super K> strategy)
      Creates a mutable linked map with a default new-value-selecting merge function.
      参数:
      strategy - the hashing strategy
    • MutableHashedLinkedMap

      public MutableHashedLinkedMap(it.unimi.dsi.fastutil.Hash.Strategy<? super K> strategy, MutableHashedLinkedMap.MergeFunction<K,V> merge)
      Creates a mutable linked map with a custom merge function.
      参数:
      strategy - the hashing strategy
      merge - the function used when merging an existing value and a new value
  • 方法详细资料

    • put

      @Nullable public V put(K key, V value)
      Inserts the mapping with the specified key and value pair.

      If there is a mapping already associated with this key, then the previous value and the specified (new) value are merged according to this collection's merge function, and the position of the entry is not modified. If there is no such mapping, then the key-value mapping is inserted at the end of this collection.

      参数:
      key - key to be inserted
      value - (new) value to be associated with the key
      返回:
      the previous value associated with the specified key, or null if there was no mapping for the key
    • contains

      public boolean contains(K key)
    • isEmpty

      public boolean isEmpty()
    • remove

      @Nullable public V remove(K key)
    • get

      @Nullable public V get(K key)
    • iterator

      public Iterator<Map.Entry<K,V>> iterator()
      指定者:
      iterator 在接口中 Iterable<K>
    • putFirst

      @Nullable public V putFirst(K key, V value)
      Inserts the mapping with the specified key and value pair at the beginning of this map.

      If there is a mapping already associated with this key, then the previous value and the specified (new) value are first merged according to this map's merge function, then the entry is moved to the beginning of the map.

      参数:
      key - key to be inserted at the beginning
      value - (new) value to be associated with the key
      返回:
      the previous value associated with the specified key, or null if there was no mapping for the key
      另请参阅:
    • putAfter

      @Nullable public V putAfter(K after, K key, V value)
      Inserts the mapping with this key and value pair immediately after the entry with the specified positioning key.

      If the specified positioning key is not present within this map, then this method behaves like put(Object, Object). If there is a mapping already associated with this key, then the previous value and the specified (new) value are first merged according to this map's merge function, then the entry is moved to directly after the entry with the specified positioning key.

      参数:
      after - the key to position this new entry afterwards
      key - key to be inserted at the beginning
      value - (new) value to be associated with the key
      返回:
      the previous value associated with the specified key, or null if there was no mapping for the key
      另请参阅:
    • putBefore

      @Nullable public V putBefore(K before, K key, V value)
      Inserts the mapping with this key and value pair immediately before the entry with the specified positioning key.

      If the specified positioning key is not present within this map, then this method behaves like put(Object, Object). If there is a mapping already associated with this key, then the previous value and the specified (new) value are first merged according to this map's merge function, then the entry is moved to directly before the entry with the specified positioning key.

      参数:
      before - the key to position this new entry afterwards
      key - key to be inserted at the beginning
      value - (new) value to be associated with the key
      返回:
      the previous value associated with the specified key, or null if there was no mapping for the key
      另请参阅:
    • remove

      private void remove(MutableHashedLinkedMap<K,V>.Entry e)