Class IngredientChannelAdapterWrapperSlotted<T,M>

java.lang.Object
org.cyclops.integrateddynamics.core.network.IngredientChannelAdapterWrapperSlotted<T,M>
Type Parameters:
T - The instance type.
M - The matching condition parameter.
All Implemented Interfaces:
Iterable<T>, org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>, org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorageSlotted<T,M>

public class IngredientChannelAdapterWrapperSlotted<T,M> extends Object implements org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorageSlotted<T,M>
A slotted wrapper over IngredientChannelAdapter. It exposes slots by chaining storages sequentially, not using the index.
  • Constructor Details

    • IngredientChannelAdapterWrapperSlotted

      public IngredientChannelAdapterWrapperSlotted(IngredientChannelAdapter<T,M> channel, it.unimi.dsi.fastutil.ints.Int2IntMap cacheChannelSlots)
  • Method Details

    • getIngredientComponentStorageSize

      protected static int getIngredientComponentStorageSize(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<?,?> storage)
    • getSlots

      public int getSlots()
      Specified by:
      getSlots in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorageSlotted<T,M>
    • getStorageAndRelativeSlot

      protected org.apache.commons.lang3.tuple.Triple<org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>,Integer,PartPos> getStorageAndRelativeSlot(int slot)
    • getSlotContents

      public T getSlotContents(int slotAbsolute)
      Specified by:
      getSlotContents in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorageSlotted<T,M>
    • getMaxQuantity

      public long getMaxQuantity(int slotAbsolute)
      Specified by:
      getMaxQuantity in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorageSlotted<T,M>
    • insert

      public T insert(int slotAbsolute, @Nonnull T ingredient, boolean simulate)
      Specified by:
      insert in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorageSlotted<T,M>
    • extract

      public T extract(int slotAbsolute, long maxQuantity, boolean simulate)
      Specified by:
      extract in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorageSlotted<T,M>
    • getComponent

      public org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T,M> getComponent()
      Specified by:
      getComponent in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>
      Specified by:
      iterator in interface Iterable<T>
    • iterator

      public Iterator<T> iterator(@Nonnull T prototype, M matchCondition)
      Specified by:
      iterator in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>
    • getMaxQuantity

      public long getMaxQuantity()
      Specified by:
      getMaxQuantity in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>
    • insert

      public T insert(@Nonnull T ingredient, boolean simulate)
      Specified by:
      insert in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>
    • extract

      public T extract(@Nonnull T prototype, M matchCondition, boolean simulate)
      Specified by:
      extract in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>
    • extract

      public T extract(long maxQuantity, boolean simulate)
      Specified by:
      extract in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>