Class RecipeIndexDefault

java.lang.Object
org.cyclops.integratedcrafting.core.RecipeIndexDefault
All Implemented Interfaces:
IRecipeIndex, IRecipeIndexModifiable

public class RecipeIndexDefault extends Object implements IRecipeIndexModifiable
A default implementation of IRecipeIndex and IRecipeIndexModifiable.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addRecipe(org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition prioritizedRecipe)
    Add the given recipe to this index.
    protected <T, M> void
    addRecipeForComponent(org.cyclops.cyclopscore.ingredient.collection.IIngredientMapMutable<T,M,Set<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition>> index, org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition prioritizedRecipe)
     
    Set<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition>
     
    <T, M> Iterator<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition>
    getRecipes(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T,M> outputType, T output, M matchCondition)
    Find recipes with the given output.
    protected <T, M> org.cyclops.cyclopscore.ingredient.collection.IIngredientMapMutable<T,M,Set<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition>>
    initializeIndex(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T,M> recipeComponent)
     
    void
    removeRecipe(org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition prioritizedRecipe)
    Remove the given recipe from this index.
    protected <T, M> void
    removeRecipeForComponent(org.cyclops.cyclopscore.ingredient.collection.IIngredientMapMutable<T,M,Set<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition>> index, org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition prioritizedRecipe)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RecipeIndexDefault

      public RecipeIndexDefault()
  • Method Details

    • getRecipes

      public Set<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition> getRecipes()
      Specified by:
      getRecipes in interface IRecipeIndex
      Returns:
      All recipes that are available.
    • getRecipes

      public <T, M> Iterator<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition> getRecipes(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T,M> outputType, T output, M matchCondition)
      Description copied from interface: IRecipeIndex
      Find recipes with the given output.
      Specified by:
      getRecipes in interface IRecipeIndex
      Type Parameters:
      T - The instance type.
      M - The matching condition parameter, may be Void.
      Parameters:
      outputType - The recipe component type.
      output - An output ingredient instance.
      matchCondition - A condition under which the matching should be done.
      Returns:
      An iterator of the recipes that have the given output.
    • initializeIndex

      @Nullable protected <T, M> org.cyclops.cyclopscore.ingredient.collection.IIngredientMapMutable<T,M,Set<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition>> initializeIndex(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T,M> recipeComponent)
    • addRecipe

      public void addRecipe(org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition prioritizedRecipe)
      Description copied from interface: IRecipeIndexModifiable
      Add the given recipe to this index.
      Specified by:
      addRecipe in interface IRecipeIndexModifiable
      Parameters:
      prioritizedRecipe - A recipe.
    • addRecipeForComponent

      protected <T, M> void addRecipeForComponent(org.cyclops.cyclopscore.ingredient.collection.IIngredientMapMutable<T,M,Set<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition>> index, org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition prioritizedRecipe)
    • removeRecipe

      public void removeRecipe(org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition prioritizedRecipe)
      Description copied from interface: IRecipeIndexModifiable
      Remove the given recipe from this index.
      Specified by:
      removeRecipe in interface IRecipeIndexModifiable
      Parameters:
      prioritizedRecipe - A recipe.
    • removeRecipeForComponent

      protected <T, M> void removeRecipeForComponent(org.cyclops.cyclopscore.ingredient.collection.IIngredientMapMutable<T,M,Set<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition>> index, org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition prioritizedRecipe)