Class IngredientChannelAdapter<T,M>

java.lang.Object
org.cyclops.integrateddynamics.core.network.IngredientChannelAdapter<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>, INetworkIngredientsChannel<T,M>
Direct Known Subclasses:
IngredientChannelIndexed, IngredientChannelPositioned

public abstract class IngredientChannelAdapter<T,M> extends Object implements INetworkIngredientsChannel<T,M>
An abstract IIngredientComponentStorage that wraps over a IPositionedAddonsNetworkIngredients.
  • Constructor Details

  • Method Details

    • enableLimits

      public void enableLimits()
    • disableLimits

      public void disableLimits()
    • getNetwork

      public IPositionedAddonsNetworkIngredients<T,M> getNetwork()
    • getChannel

      public int getChannel()
    • 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>
    • getNonFullPositions

      protected abstract Iterator<PartPos> getNonFullPositions()
    • getAllPositions

      protected abstract Iterator<PartPos> getAllPositions()
    • getNonEmptyPositions

      protected abstract Iterator<PartPos> getNonEmptyPositions()
    • getMatchingPositions

      protected abstract Iterator<PartPos> getMatchingPositions(@Nonnull T prototype, M matchFlags)
    • findNonFullPositions

      public Iterable<PartPos> findNonFullPositions()
      Specified by:
      findNonFullPositions in interface INetworkIngredientsChannel<T,M>
    • findAllPositions

      public Iterable<PartPos> findAllPositions()
      Specified by:
      findAllPositions in interface INetworkIngredientsChannel<T,M>
    • findNonEmptyPositions

      public Iterable<PartPos> findNonEmptyPositions()
      Specified by:
      findNonEmptyPositions in interface INetworkIngredientsChannel<T,M>
    • findMatchingPositions

      public Iterable<PartPos> findMatchingPositions(@Nonnull T prototype, M matchFlags)
      Specified by:
      findMatchingPositions in interface INetworkIngredientsChannel<T,M>
    • getMaxQuantity

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

      protected org.apache.commons.lang3.tuple.Pair<IPartPosIteratorHandler,Iterator<PartPos>> getPartPosIteratorData(Supplier<Iterator<PartPos>> iteratorSupplier, int channel)
    • savePartPosIteratorHandler

      protected void savePartPosIteratorHandler(IPartPosIteratorHandler partPosIteratorHandler)
    • markStoragePositionChanged

      protected void markStoragePositionChanged(int channel, PartPos targetPos)
    • 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(long maxQuantity, boolean simulate)
      Specified by:
      extract in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>
    • extract

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

      protected T finalizeExtraction(T instancePrototype, M matchFlags, org.apache.commons.lang3.tuple.Pair<org.cyclops.cyclopscore.datastructure.Wrapper<Long>,List<PartPos>> value, boolean simulate)
    • scheduleObservation

      protected void scheduleObservation()