Interface IIngredientCollectionMutable<T,M>
- Type Parameters:
T
- The instance type.M
- The matching condition parameter.
- All Superinterfaces:
IIngredientCollection<T,
,M> IIngredientCollectionLike<T,
,M, T> Iterable<T>
- All Known Subinterfaces:
IIngredientCollapsedCollectionMutable<T,
,M> IIngredientListMutable<T,
,M> IIngredientSetMutable<T,
M>
- All Known Implementing Classes:
IngredientArrayList
,IngredientCollectionAdapter
,IngredientCollectionCollectionAdapter
,IngredientCollectionCollectionWrappedAdapter
,IngredientCollectionMultiClassified
,IngredientCollectionMutableWrapper
,IngredientCollectionPrototypeMap
,IngredientCollectionQuantitativeGrouper
,IngredientCollectionSingleClassified
,IngredientCollectionSingleClassifiedCollapsed
,IngredientHashSet
,IngredientLinkedList
,IngredientList
,IngredientSet
,IngredientTreeSet
A mutable collection of ingredient component instances.
This does not conform to the
Collection
interface
as instances are compared using the matcher in IngredientComponent.getMatcher()
.-
Method Summary
Modifier and TypeMethodDescriptionboolean
Add the given instance to the collection.default boolean
Add the given instances to the collection.void
clear()
Clears this collection of all instances.boolean
Remove the given instance from the collection.default int
Remove all the given instances from the collection.default 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 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
-
Method Details
-
add
Add the given instance to the collection.- 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
Add the given instances to the collection.- 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
Remove the given instance from the collection.- 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
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.- Parameters:
instance
- An instance.matchCondition
- A match condition.- Returns:
- The number of removed instances.
-
removeAll
Remove all the given instances from the collection.- Parameters:
instances
- Instances.- Returns:
- The number of removed instances.
-
removeAll
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.- Parameters:
instances
- Instances.matchCondition
- A match condition.- Returns:
- The number of removed instances.
-
clear
void clear()Clears this collection of all instances.
-