Class IngredientNode
java.lang.Object
com.tccc.kos.ext.dispense.pipeline.beverage.graph.GraphNode
com.tccc.kos.ext.dispense.pipeline.beverage.graph.OrNode
com.tccc.kos.ext.dispense.pipeline.beverage.graph.IngredientNode
- All Implemented Interfaces:
Comparable<GraphNode>
A
GraphNode
that represents an ingredient.
This is simply an OR node with a type of "INGREDIENT". It stores an ingredient ID independent of the node ID, in the event that the node ID cannot be the ingredient ID due to ID collisions.
Child nodes of an ingredient node are typically pump nodes. This allows for multiple sources of an ingredient to be represented as a single ingredient to the next layer in the graph, which is typically beverages. This allows a beverage to depend on an ingredient such as orange, but not care if there are two pumps that have orange assigned. So long as either of the pumps are available, the ingredient is available.
BevGraphBuilder
provides addIngredientNodes()
which builds the ingredient layer of nodes automatically.
- Since:
- 1.0
- Version:
- 2023-02-10
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIngredientNode
(BaseIngredient ingredient) Creates an ingredient node where the giveningredientId
is both theid
andaltId
of the node.IngredientNode
(String id, BaseIngredient ingredient) Creates an ingredient node where theid
of the node is distinct from the associatedingredientId
. -
Method Summary
Modifier and TypeMethodDescriptionReturns the ingredient ID of the node, which is this node'saltId
.toString()
Methods inherited from class com.tccc.kos.ext.dispense.pipeline.beverage.graph.OrNode
computeAvailable, computeVisible
Methods inherited from class com.tccc.kos.ext.dispense.pipeline.beverage.graph.GraphNode
addOverride, compareTo, equals, getAltId, getChildren, getChildrenIds, getClientData, getData, getId, getNote, getOverrides, getParentIds, getType, getVersion, hashCode, isAvailable, isVisible, removeOverride, removeOverride, setAltId, setClientData, setData, setNote, setType
-
Field Details
-
TYPE
- See Also:
-
-
Constructor Details
-
IngredientNode
Creates an ingredient node where the giveningredientId
is both theid
andaltId
of the node.- Parameters:
ingredient
- both ID and altId of the node are ingredientId
-
IngredientNode
Creates an ingredient node where theid
of the node is distinct from the associatedingredientId
. TheingredientId
is stored in the node'saltId
field.- Parameters:
id
- ID of the nodeingredient
- the ingredient for the node
-
-
Method Details