Interface IIngredientMap<T,M,V>

Type Parameters:
T - The instance type.
M - The matching condition parameter.
V - The type of mapped values.
All Superinterfaces:
IIngredientCollectionLike<T,M,Map.Entry<T,V>>, Iterable<Map.Entry<T,V>>
All Known Subinterfaces:
IIngredientMapMutable<T,M,V>
All Known Implementing Classes:
IngredientHashMap, IngredientMapAdapter, IngredientMapMultiClassified, IngredientMapSingleClassified, IngredientMapWrappedAdapter, IngredientTreeMap

public interface IIngredientMap<T,M,V> extends IIngredientCollectionLike<T,M,Map.Entry<T,V>>
A mapping from ingredient component instances to values of any type. This does not conform to the Map interface as instances are compared using the matcher in IngredientComponent.getMatcher().
  • Method Details

    • containsKey

      default boolean containsKey(T instance)
      Check if this map contains the given instance. This instance will be compared based on the matcher from the ingredient component type.
      Parameters:
      instance - An instance.
      Returns:
      If this map contains the given instance.
    • containsKey

      default boolean containsKey(T instance, M matchCondition)
      Check if this map contains the given instance under the given match conditions. This instance will be compared based on the matcher from the ingredient component type using the given match condition.
      Parameters:
      instance - An instance.
      matchCondition - A match condition.
      Returns:
      If this map contains the given instance under the given match conditions.
    • containsKeyAll

      default boolean containsKeyAll(Iterable<? extends T> instances)
      Check if this map contains all the given instances. The instances will be compared based on the matcher from the ingredient component type.
      Parameters:
      instances - Instances.
      Returns:
      If this map contains all the given instances.
    • containsKeyAll

      default boolean containsKeyAll(Iterable<? extends T> instances, M matchCondition)
      Check if this map contains all the given instances under the given match conditions. The instances will be compared based on the matcher from the ingredient component type using the given match condition.
      Parameters:
      instances - Instances.
      matchCondition - A match condition.
      Returns:
      If this map contains all the given instances under the given match conditions.
    • containsValue

      boolean containsValue(V value)
      Check if this map contains the given value.
      Parameters:
      value - A value.
      Returns:
      If this map contains the given value.
    • countKey

      default int countKey(T instance, M matchCondition)
      Count the number of occurrences of the given instance under the given match conditions. This instance will be compared based on the matcher from the ingredient component type using the given match condition.
      Parameters:
      instance - An instance.
      matchCondition - A match condition.
      Returns:
      The number of occurrences of the given instance under the given match conditions.
    • get

      @Nullable V get(T key)
      Get the value for the given instance.
      Parameters:
      key - An instance.
      Returns:
      The value.
    • getAll

      Collection<V> getAll(T key, M matchCondition)
      Get all values for all instances that match with the given instance under the given match conditions. This instance will be compared based on the matcher from the ingredient component type using the given match condition.
      Parameters:
      key - An instance.
      matchCondition - A match condition.
      Returns:
      All matching values.
    • keySet

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

      IngredientSet<T,M> keySet(T key, M matchCondition)
      Get all key instances that match the given instance. This instance will be compared based on the matcher from the ingredient component type using the given match condition.
      Parameters:
      key - An instance.
      matchCondition - A match condition.
      Returns:
      All key instances that match the given instance.
    • values

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

      Set<Map.Entry<T,V>> entrySet()
      Returns:
      All instance-value entries in this map.