Class IngredientMapWrappedAdapter<T,M,V,C extends Map<IngredientInstanceWrapper<T,M>,V>>

java.lang.Object
org.cyclops.cyclopscore.ingredient.collection.IngredientMapAdapter<T,M,V>
org.cyclops.cyclopscore.ingredient.collection.IngredientMapWrappedAdapter<T,M,V,C>
Type Parameters:
T - The instance type.
M - The matching condition parameter.
V - The type of mapped values.
All Implemented Interfaces:
Iterable<Map.Entry<T,V>>, IIngredientCollectionLike<T,M,Map.Entry<T,V>>, IIngredientMap<T,M,V>, IIngredientMapMutable<T,M,V>
Direct Known Subclasses:
IngredientHashMap, IngredientTreeMap

public abstract class IngredientMapWrappedAdapter<T,M,V,C extends Map<IngredientInstanceWrapper<T,M>,V>> extends IngredientMapAdapter<T,M,V>
An abstract ingredient map adapter.
  • Constructor Details

    • IngredientMapWrappedAdapter

      protected IngredientMapWrappedAdapter(IngredientComponent<T,M> component, C collection)
  • Method Details

    • getCollection

      protected C getCollection()
    • wrap

      protected IngredientInstanceWrapper<T,M> wrap(T instance)
    • clear

      public void clear()
      Description copied from interface: IIngredientMapMutable
      Clears this map of all instances.
    • put

      @Nullable public V put(T key, V value)
      Description copied from interface: IIngredientMapMutable
      Add a new entry.
      Parameters:
      key - An instance key.
      value - A value.
      Returns:
      The previous value that was associated with the given instance.
    • remove

      @Nullable public V remove(T key)
      Description copied from interface: IIngredientMapMutable
      Remove the mapping for the given key instance.
      Parameters:
      key - An instance key.
      Returns:
      The value that was associated with the given instance.
    • size

      public int size()
      Returns:
      The number of instances contained in this collection.
    • containsValue

      public boolean containsValue(V value)
      Description copied from interface: IIngredientMap
      Check if this map contains the given value.
      Parameters:
      value - A value.
      Returns:
      If this map contains the given value.
    • get

      @Nullable public V get(T key)
      Description copied from interface: IIngredientMap
      Get the value for the given instance.
      Parameters:
      key - An instance.
      Returns:
      The value.
    • keySet

      public IngredientSet<T,M> keySet()
      Returns:
      All key instances.
    • values

      public Collection<V> values()
      Returns:
      All values.
    • iterator

      public Iterator<Map.Entry<T,V>> iterator()