Class OrNode
java.lang.Object
com.tccc.kos.ext.dispense.pipeline.beverage.graph.GraphNode
com.tccc.kos.ext.dispense.pipeline.beverage.graph.OrNode
- All Implemented Interfaces:
Comparable<GraphNode>
- Direct Known Subclasses:
IngredientNode
A
GraphNode
that reports availability as the logical OR
of all of its child nodes. That is, this node is available/visible if
any of its child nodes is available/visible.
This is useful for relationships such as a beverages in a brand, where a brand is available when any beverage associated with the brand is available.
The default type of this node is "OR", but a custom type can be used to allow for improved searchability.
- Since:
- 1.0
- Version:
- 2023-02-10
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Computes this node's availability.boolean
Computes this node's visiblity.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
-
OrNode
Creates an OR node with the specified ID and a type of "OR".- Parameters:
id
- the ID of the node
-
OrNode
Creates an OR node with the specified ID and type.Although the node has the specified type name, it still functions as an OR node. This is useful for creating a layer of OR 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 visiblity.An OR node is visible if any of its child nodes are visible.
- Overrides:
computeVisible
in classGraphNode
-
computeAvailable
public boolean computeAvailable()Computes this node's availability.An OR node is available if any of its child nodes are available.
- Overrides:
computeAvailable
in classGraphNode
-