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 Details

    • IngredientCollectionMutableWrapper

      public IngredientCollectionMutableWrapper(W innerCollection)
  • Method Details

    • add

      public boolean add(T instance)
      Description copied from interface: IIngredientCollectionMutable
      Add the given instance to the collection.
      Specified by:
      add in interface IIngredientCollectionMutable<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

      public boolean addAll(Iterable<? extends T> instances)
      Description copied from interface: IIngredientCollectionMutable
      Add the given instances to the collection.
      Specified by:
      addAll in interface IIngredientCollectionMutable<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

      public boolean remove(T instance)
      Description copied from interface: IIngredientCollectionMutable
      Remove the given instance from the collection.
      Specified by:
      remove in interface IIngredientCollectionMutable<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

      public int removeAll(T instance, M matchCondition)
      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 interface IIngredientCollectionMutable<T,M>
      Parameters:
      instance - An instance.
      matchCondition - A match condition.
      Returns:
      The number of removed instances.
    • removeAll

      public int removeAll(Iterable<? extends T> instances)
      Description copied from interface: IIngredientCollectionMutable
      Remove all the given instances from the collection.
      Specified by:
      removeAll in interface IIngredientCollectionMutable<T,M>
      Parameters:
      instances - Instances.
      Returns:
      The number of removed instances.
    • removeAll

      public int removeAll(Iterable<? extends T> instances, M matchCondition)
      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 interface IIngredientCollectionMutable<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 interface IIngredientCollectionMutable<T,M>