Class BlenderRecipe
java.lang.Object
net.messagevortex.blender.recipes.BlenderRecipe
- All Implemented Interfaces:
Comparable<BlenderRecipe>
- Direct Known Subclasses:
LowAnonRecipe,SimplePathRecipe
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddRecipe(String identifier, BlenderRecipe add) Adds a recipe to the specified recipe list.abstract RoutingComboapplyRecipe(Set<IdentityStoreBlock> anonSet, IdentityStoreBlock from, IdentityStoreBlock to) Creates a routing block with the given parameters.static voidclearRecipes(String identifier) Remove all recipes from the specified list of recipes.intstatic BlenderRecipegetRecipe(String identifier, Set<IdentityStoreBlock> anonSet) Get a recipe from the specified recipe set.abstract booleanisAppliable(Set<IdentityStoreBlock> anonSet) Tests if the given recipe may be applied to the anon set available.
-
Constructor Details
-
BlenderRecipe
public BlenderRecipe()
-
-
Method Details
-
getRecipe
public static BlenderRecipe getRecipe(String identifier, Set<IdentityStoreBlock> anonSet) throws IOException Get a recipe from the specified recipe set.
- Parameters:
identifier- the name of the recipe setanonSet- the anonymity set to be used- Returns:
- a random recipe
- Throws:
IOException- if no candidates can be found
-
clearRecipes
Remove all recipes from the specified list of recipes.
- Parameters:
identifier- the recipe list identifier (null for default list)
-
addRecipe
Adds a recipe to the specified recipe list.
- Parameters:
identifier- the name of the recipe list (null for default)add- the recipe to be added
-
isAppliable
Tests if the given recipe may be applied to the anon set available.
- Parameters:
anonSet- the currently available anonymity set- Returns:
- true if the recipe may be applied
-
applyRecipe
public abstract RoutingCombo applyRecipe(Set<IdentityStoreBlock> anonSet, IdentityStoreBlock from, IdentityStoreBlock to) throws IOException Creates a routing block with the given parameters.
- Parameters:
anonSet- the anonymity set to be usedfrom- the sending node addressto- the receiving node address- Returns:
- the built routing block
- Throws:
IOException- if a problem arises when creating the block
-
compareTo
- Specified by:
compareToin interfaceComparable<BlenderRecipe>
-