Class AndNode
java.lang.Object
com.tccc.kos.ext.dispense.pipeline.beverage.graph.GraphNode
com.tccc.kos.ext.dispense.pipeline.beverage.graph.AndNode
- All Implemented Interfaces:
Comparable<GraphNode>
- Direct Known Subclasses:
BeverageNode
A
GraphNode
that reports availability as the logical AND
of all of its child nodes. That is, this node is available/visible only if
all all of its child nodes are available/visible.
This is useful for all-or-nothing relationships, such as a beverage only being available when all ingredients required by the beverage are available.
The default type of this node is "AND", but a custom type can be used to allow for improved searchability.
- Since:
- 1.0
- Version:
- 2023-02-07
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Computes this node's availability.boolean
Computes this node's visibility.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, toString
-
Field Details
-
TYPE
- See Also:
-
-
Constructor Details
-
AndNode
Creates an AND node with the specified ID and a type of "AND".- Parameters:
id
- the ID of the node
-
AndNode
Creates an AND node with the specified ID and type.Although the node has the specified type name, it still functions as an AND node. This is useful for creating a layer of AND nodes in a graph that can be easily searched by type.
- Parameters:
type
- the type of the nodeid
- the ID of the node
-
-
Method Details
-
computeVisible
public boolean computeVisible()Computes this node's visibility.An AND node is visible only when all of its child nodes are visible.
- Overrides:
computeVisible
in classGraphNode
-
computeAvailable
public boolean computeAvailable()Computes this node's availability.An AND node is available only when all of its child nodes are available.
- Overrides:
computeAvailable
in classGraphNode
-