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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionentrySet()booleanCheck if this collection equals the given object.Get all values for all instances that match with the given instance under the given match conditions.inthashCode()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.intRemove all occurrences of the given key instance under the given match conditions.toString()Methods inherited from interface IIngredientCollectionLike
isEmpty, sizeMethods inherited from interface IIngredientMap
containsKey, containsKey, containsKeyAll, containsKeyAll, containsValue, countKey, get, keySet, valuesMethods inherited from interface IIngredientMapMutable
clear, put, putAll, remove, removeAll, removeAllMethods inherited from interface Iterable
forEach, iterator, spliterator
-
Constructor Details
-
IngredientMapAdapter
-
-
Method Details
-
getComponent
- Specified by:
getComponentin interfaceIIngredientCollectionLike<T,M, V> - Returns:
- The ingredient component type of which this collection contains instances.
-
removeAll
Description copied from interface:IIngredientMapMutableRemove 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:
removeAllin interfaceIIngredientMapMutable<T,M, V> - Parameters:
instance- An instance.matchCondition- A match condition.- Returns:
- The number of removed instances.
-
iterator
Description copied from interface:IIngredientCollectionLikeAn iterator over this collection over all occurrences of the given instance under the given match conditions.- Specified by:
iteratorin 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:IIngredientMapGet 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:
getAllin interfaceIIngredientMap<T,M, V> - Parameters:
key- An instance.matchCondition- A match condition.- Returns:
- All matching values.
-
keySet
Description copied from interface:IIngredientMapGet 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:
keySetin interfaceIIngredientMap<T,M, V> - Parameters:
instance- An instance.matchCondition- A match condition.- Returns:
- All key instances that match the given instance.
-
entrySet
-
equals
Description copied from interface:IIngredientCollectionLikeCheck if this collection equals the given object. -
hashCode
-
toString
-