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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Add the given instance to the collection.boolean
Add the given instances to the collection.void
clear()
Clears this collection of all instances.boolean
Remove the given instance from the collection.int
Remove all the given instances from the collection.int
Remove all occurrences of the given instances under the given match conditions.int
Remove 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, 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.IIngredientCollection
contains, contains, containsAll, containsAll, count, iterator, parallelStream, spliterator, stream, toArray
Methods 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:IIngredientCollectionMutable
Add the given instance to the collection.- Specified by:
add
in 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:IIngredientCollectionMutable
Add the given instances to the collection.- Specified by:
addAll
in 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:IIngredientCollectionMutable
Remove the given instance from the collection.- Specified by:
remove
in 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:IIngredientCollectionMutable
Remove 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:
removeAll
in interfaceIIngredientCollectionMutable<T,
M> - Parameters:
instance
- An instance.matchCondition
- A match condition.- Returns:
- The number of removed instances.
-
removeAll
Description copied from interface:IIngredientCollectionMutable
Remove all the given instances from the collection.- Specified by:
removeAll
in interfaceIIngredientCollectionMutable<T,
M> - Parameters:
instances
- Instances.- Returns:
- The number of removed instances.
-
removeAll
Description copied from interface:IIngredientCollectionMutable
Remove 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:
removeAll
in interfaceIIngredientCollectionMutable<T,
M> - Parameters:
instances
- Instances.matchCondition
- A match condition.- Returns:
- The number of removed instances.
-
clear
public void clear()Description copied from interface:IIngredientCollectionMutable
Clears this collection of all instances.- Specified by:
clear
in interfaceIIngredientCollectionMutable<T,
M>
-