Class IngredientCollectionAdapter<T,M>
java.lang.Object
org.cyclops.cyclopscore.ingredient.collection.IngredientCollectionAdapter<T,M>
- Type Parameters:
T- The instance type.M- The matching condition parameter.
- All Implemented Interfaces:
Iterable<T>,IIngredientCollection<T,,M> IIngredientCollectionLike<T,,M, T> IIngredientCollectionMutable<T,M>
- Direct Known Subclasses:
IngredientCollectionCollectionAdapter,IngredientCollectionCollectionWrappedAdapter,IngredientCollectionMultiClassified,IngredientCollectionPrototypeMap,IngredientCollectionSingleClassified
public abstract class IngredientCollectionAdapter<T,M>
extends Object
implements IIngredientCollectionMutable<T,M>
An adapter class for mutable ingredient collections.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if this collection contains the given instance.booleanCheck if this collection contains the given instance under the given match conditions.intCount the number of occurrences of 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.booleanRemove the given instance from the collection.intRemove all occurrences of the given instance under the given match conditions.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.cyclops.cyclopscore.ingredient.collection.IIngredientCollection
containsAll, containsAll, parallelStream, spliterator, stream, toArrayMethods inherited from interface org.cyclops.cyclopscore.ingredient.collection.IIngredientCollectionLike
equals, isEmpty, size
-
Constructor Details
-
IngredientCollectionAdapter
-
-
Method Details
-
getComponent
- Specified by:
getComponentin interfaceIIngredientCollectionLike<T,M, T> - Returns:
- The ingredient component type of which this collection contains instances.
-
remove
Description copied from interface:IIngredientCollectionMutableRemove the given instance from the collection.- Specified by:
removein interfaceIIngredientCollectionMutable<T,M> - Parameters:
instance- An instance.- Returns:
- If the collection was changed due to this addition. Can be false if the collection did not contain the instance.
-
removeAll
Description copied from interface:IIngredientCollectionMutableRemove all 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.- Specified by:
removeAllin interfaceIIngredientCollectionMutable<T,M> - Parameters:
instance- An instance.matchCondition- A match condition.- Returns:
- The number of removed instances.
-
contains
Description copied from interface:IIngredientCollectionCheck if this collection contains the given instance. This instance will be compared based on the matcher from the ingredient component type.- Specified by:
containsin interfaceIIngredientCollection<T,M> - Parameters:
instance- An instance.- Returns:
- If this collection contains the given instance.
-
contains
Description copied from interface:IIngredientCollectionCheck if this collection 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.- Specified by:
containsin interfaceIIngredientCollection<T,M> - Parameters:
instance- An instance.matchCondition- A match condition.- Returns:
- If this collection contains the given instance under the given match conditions.
-
count
Description copied from interface:IIngredientCollectionCount 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.- Specified by:
countin interfaceIIngredientCollection<T,M> - Parameters:
instance- An instance.matchCondition- A match condition.- Returns:
- The number of occurrences of the given instance under the given match conditions.
-
iterator
Description copied from interface:IIngredientCollectionAn iterator over this collection over all occurrences of the given instance under the given match conditions.- Specified by:
iteratorin interfaceIIngredientCollection<T,M> - Specified by:
iteratorin interfaceIIngredientCollectionLike<T,M, T> - 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.
-
hashCode
public int hashCode() -
toString
-