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
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 Summary
Modifier and TypeMethodDescriptiondefault boolean
containsKey
(T instance) Check if this map contains the given instance.default boolean
containsKey
(T instance, M matchCondition) Check if this map contains the given instance under the given match conditions.default boolean
containsKeyAll
(Iterable<? extends T> instances) Check if this map contains all the given instances.default boolean
containsKeyAll
(Iterable<? extends T> instances, M matchCondition) Check if this map contains all the given instances under the given match conditions.boolean
containsValue
(V value) Check if this map contains the given value.default int
Count the number of occurrences of the given instance under the given match conditions.entrySet()
Get the value for the given instance.Get all values for all instances that match with the given instance under the given match conditions.keySet()
Get all key instances that match the given instance.values()
Methods inherited from interface org.cyclops.cyclopscore.ingredient.collection.IIngredientCollectionLike
equals, getComponent, hashCode, isEmpty, iterator, size, toString
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
containsKey
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
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
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
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
Check if this map contains the given value.- Parameters:
value
- A value.- Returns:
- If this map contains the given value.
-
countKey
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
Get the value for the given instance.- Parameters:
key
- An instance.- Returns:
- The value.
-
getAll
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
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
- Returns:
- All instance-value entries in this map.
-