Class IngredientCollectionMutableWrapper<T,M,W extends IIngredientCollectionMutable<T,M>>
java.lang.Object
org.cyclops.cyclopscore.ingredient.collection.IngredientCollectionWrapper<T,M,W>
org.cyclops.cyclopscore.ingredient.collection.IngredientCollectionMutableWrapper<T,M,W>
- Type Parameters:
T- An 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:
IngredientCollectionQuantitativeGrouper
public class IngredientCollectionMutableWrapper<T,M,W extends IIngredientCollectionMutable<T,M>>
extends IngredientCollectionWrapper<T,M,W>
implements IIngredientCollectionMutable<T,M>
A mutable ingredient collection that wraps over another mutable ingredient collection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdd the given instance to the collection.booleanAdd the given instances to the collection.voidclear()Clears this collection of all instances.booleanRemove the given instance from the collection.intRemove all the given instances from the collection.intRemove all occurrences of the given instances under the given match conditions.intRemove all occurrences of the given instance under the given match conditions.Methods inherited from class org.cyclops.cyclopscore.ingredient.collection.IngredientCollectionWrapper
contains, contains, containsAll, containsAll, count, equals, getComponent, getInnerCollection, hashCode, isEmpty, iterator, iterator, size, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.cyclops.cyclopscore.ingredient.collection.IIngredientCollection
contains, contains, containsAll, containsAll, count, iterator, parallelStream, spliterator, stream, toArrayMethods inherited from interface org.cyclops.cyclopscore.ingredient.collection.IIngredientCollectionLike
equals, getComponent, hashCode, isEmpty, size, toString
-
Constructor Details
-
IngredientCollectionMutableWrapper
-
-
Method Details
-
add
Description copied from interface:IIngredientCollectionMutableAdd the given instance to the collection.- Specified by:
addin interfaceIIngredientCollectionMutable<T,M> - Parameters:
instance- An instance.- Returns:
- If the collection was changed due to this addition. This can be false in the case of sets in which each instance can only exists once.
-
addAll
Description copied from interface:IIngredientCollectionMutableAdd the given instances to the collection.- Specified by:
addAllin interfaceIIngredientCollectionMutable<T,M> - Parameters:
instances- Instances.- Returns:
- If the collection was changed due to this addition. This can be false in the case of sets in which each instance can only exists once.
-
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.
-
removeAll
Description copied from interface:IIngredientCollectionMutableRemove all the given instances from the collection.- Specified by:
removeAllin interfaceIIngredientCollectionMutable<T,M> - Parameters:
instances- Instances.- Returns:
- The number of removed instances.
-
removeAll
Description copied from interface:IIngredientCollectionMutableRemove all occurrences of 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.- Specified by:
removeAllin interfaceIIngredientCollectionMutable<T,M> - Parameters:
instances- Instances.matchCondition- A match condition.- Returns:
- The number of removed instances.
-
clear
public void clear()Description copied from interface:IIngredientCollectionMutableClears this collection of all instances.- Specified by:
clearin interfaceIIngredientCollectionMutable<T,M>
-