Interface IIngredientCollapsedCollectionMutable<T,M>

Type Parameters:
T - The instance type.
M - The matching condition parameter.
All Superinterfaces:
IIngredientCollapsedCollection<T,M>, IIngredientCollection<T,M>, IIngredientCollectionLike<T,M,T>, IIngredientCollectionMutable<T,M>, Iterable<T>
All Known Implementing Classes:
IngredientCollectionPrototypeMap, IngredientCollectionQuantitativeGrouper, IngredientCollectionSingleClassifiedCollapsed

public interface IIngredientCollapsedCollectionMutable<T,M> extends IIngredientCollapsedCollection<T,M>, IIngredientCollectionMutable<T,M>
A mutable ingredient collection that does not strictly adhere to the IIngredientCollection interface and will collapse ingredients that are equal, ignoring their quantity. This collapsing will result in quantities of equal ingredients to be summed up. For example, equal ItemStacks with different counts can be added, but only a single ItemStack will be present in the collection, with as count the sum of the given counts.
  • Method Details

    • getQuantity

      long getQuantity(T instance)
      Get the quantity of the given instance.
      Parameters:
      instance - An instance, its quantity will be ignored.
      Returns:
      The quantity.
    • setQuantity

      void setQuantity(T instance, long quantity)
      Set the quantity of the given instance.
      Parameters:
      instance - An instance, its quantity will be ignored.
      quantity - The new quantity to set.