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 Summary
Modifier and TypeMethodDescriptionlonggetQuantity(T instance) Get the quantity of the given instance.voidsetQuantity(T instance, long quantity) Set the quantity of the given instance.Methods 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
-
Method Details
-
getQuantity
Get the quantity of the given instance.- Parameters:
instance- An instance, its quantity will be ignored.- Returns:
- The quantity.
-
setQuantity
Set the quantity of the given instance.- Parameters:
instance- An instance, its quantity will be ignored.quantity- The new quantity to set.
-