Class IngredientMapAdapter<T,M,V>
java.lang.Object
org.cyclops.cyclopscore.ingredient.collection.IngredientMapAdapter<T,M,V>
- 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:
IngredientMapMultiClassified
,IngredientMapSingleClassified
,IngredientMapWrappedAdapter
public abstract class IngredientMapAdapter<T,M,V>
extends Object
implements IIngredientMapMutable<T,M,V>
An abstract collection that wraps instances in a
IngredientInstanceWrapper
and stores those in a regular Map
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionentrySet()
boolean
Check if this collection equals the given object.Get all values for all instances that match with the given instance under the given match conditions.int
hashCode()
An iterator over this collection over all occurrences of the given instance under the given match conditions.Get all key instances that match the given instance.int
Remove all occurrences of the given key instance under the given match conditions.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.cyclops.cyclopscore.ingredient.collection.IIngredientCollectionLike
isEmpty, size
Methods inherited from interface org.cyclops.cyclopscore.ingredient.collection.IIngredientMap
containsKey, containsKey, containsKeyAll, containsKeyAll, containsValue, countKey, get, keySet, values
Methods inherited from interface org.cyclops.cyclopscore.ingredient.collection.IIngredientMapMutable
clear, put, putAll, remove, removeAll, removeAll
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Constructor Details
-
IngredientMapAdapter
-
-
Method Details
-
getComponent
- Specified by:
getComponent
in interfaceIIngredientCollectionLike<T,
M, V> - Returns:
- The ingredient component type of which this collection contains instances.
-
removeAll
Description copied from interface:IIngredientMapMutable
Remove all occurrences of the given key 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.- Specified by:
removeAll
in interfaceIIngredientMapMutable<T,
M, V> - Parameters:
instance
- An instance.matchCondition
- A match condition.- Returns:
- The number of removed instances.
-
iterator
Description copied from interface:IIngredientCollectionLike
An iterator over this collection over all occurrences of the given instance under the given match conditions.- Specified by:
iterator
in interfaceIIngredientCollectionLike<T,
M, V> - Parameters:
instance
- An instance.matchCondition
- A match condition.- Returns:
- An iterator over this collection over all occurrences of the given instance under the given match conditions.
-
getAll
Description copied from interface:IIngredientMap
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.- Specified by:
getAll
in interfaceIIngredientMap<T,
M, V> - Parameters:
key
- An instance.matchCondition
- A match condition.- Returns:
- All matching values.
-
keySet
Description copied from interface:IIngredientMap
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.- Specified by:
keySet
in interfaceIIngredientMap<T,
M, V> - Parameters:
instance
- An instance.matchCondition
- A match condition.- Returns:
- All key instances that match the given instance.
-
entrySet
- Specified by:
entrySet
in interfaceIIngredientMap<T,
M, V> - Returns:
- All instance-value entries in this map.
-
equals
Description copied from interface:IIngredientCollectionLike
Check if this collection equals the given object. -
hashCode
public int hashCode() -
toString
-