Class IngredientPositionsIndexEmpty<T,M>

java.lang.Object
org.cyclops.integrateddynamics.core.network.IngredientPositionsIndexEmpty<T,M>
Type Parameters:
T - An instance type.
M - The matching condition parameter.
All Implemented Interfaces:
Iterable<T>, org.cyclops.cyclopscore.ingredient.collection.IIngredientCollection<T,M>, org.cyclops.cyclopscore.ingredient.collection.IIngredientCollectionLike<T,M,T>, IIngredientPositionsIndex<T,M>

public class IngredientPositionsIndexEmpty<T,M> extends Object implements IIngredientPositionsIndex<T,M>
An empty ingredients positions index.
  • Constructor Details

    • IngredientPositionsIndexEmpty

      public IngredientPositionsIndexEmpty(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T,M> component)
  • Method Details

    • getNonEmptyPositions

      public Iterator<PartPos> getNonEmptyPositions()
      Specified by:
      getNonEmptyPositions in interface IIngredientPositionsIndex<T,M>
      Returns:
      Get all positions that are not empty.
    • getPositions

      public Iterator<PartPos> getPositions(T instance, M matchFlags)
      Description copied from interface: IIngredientPositionsIndex
      Get all positions that have an instance that contain the given instance.
      Specified by:
      getPositions in interface IIngredientPositionsIndex<T,M>
      Parameters:
      instance - An instance to match.
      matchFlags - Instance match conditions.
      Returns:
      The positions.
    • addPosition

      public void addPosition(T instance, PrioritizedPartPos pos)
      Description copied from interface: IIngredientPositionsIndex
      Indicate that the given position contains the given position.
      Specified by:
      addPosition in interface IIngredientPositionsIndex<T,M>
      Parameters:
      instance - An instance.
      pos - A position.
    • removePosition

      public void removePosition(T instance, PrioritizedPartPos pos)
      Description copied from interface: IIngredientPositionsIndex
      Indicate that the given instance is removed from the given position. This will not necessarily remove the given position, only if the total instance quantity becomes zero.
      Specified by:
      removePosition in interface IIngredientPositionsIndex<T,M>
      Parameters:
      instance - An instance.
      pos - A position.
    • getQuantity

      public long getQuantity(T instance)
      Description copied from interface: IIngredientPositionsIndex
      Get the available quantity for the given instance.
      Specified by:
      getQuantity in interface IIngredientPositionsIndex<T,M>
      Parameters:
      instance - An instance to match.
      Returns:
      The indexed quantity.
    • contains

      public boolean contains(T instance)
      Specified by:
      contains in interface org.cyclops.cyclopscore.ingredient.collection.IIngredientCollection<T,M>
    • contains

      public boolean contains(T instance, M matchCondition)
      Specified by:
      contains in interface org.cyclops.cyclopscore.ingredient.collection.IIngredientCollection<T,M>
    • count

      public int count(T instance, M matchCondition)
      Specified by:
      count in interface org.cyclops.cyclopscore.ingredient.collection.IIngredientCollection<T,M>
    • getComponent

      public org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T,M> getComponent()
      Specified by:
      getComponent in interface org.cyclops.cyclopscore.ingredient.collection.IIngredientCollectionLike<T,M,T>
    • size

      public int size()
      Specified by:
      size in interface org.cyclops.cyclopscore.ingredient.collection.IIngredientCollectionLike<T,M,T>
    • iterator

      public Iterator<T> iterator(T instance, M matchCondition)
      Specified by:
      iterator in interface org.cyclops.cyclopscore.ingredient.collection.IIngredientCollection<T,M>
      Specified by:
      iterator in interface org.cyclops.cyclopscore.ingredient.collection.IIngredientCollectionLike<T,M,T>
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>