public class FlowNode
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
depth
The depth of this node.
|
private java.util.Set<FlowNode> |
exits
Used only internally by the flow chart processing - defines the nodes which are executed,
within this block (or branch).
|
private java.lang.Integer |
groupId
Specify the group ID for this node: all nodes within the same block will have the same I
group ID.
|
private int |
id
The node's ID.
|
private boolean |
loop
Marks special nodes which are part of the loop flow (condition for WHILE/TO, assignment and
increment expression for TO).
|
private int |
order
When multiple nodes have the same depth, this is used to order them.
|
private java.lang.Integer |
parentId
For nodes within the same block (group), this ID is used to distinguish nodes with the same
depth (in cases where the code is branching for THEN/ELSE).
|
private java.lang.String |
text
The node's displayed text.
|
private java.lang.String |
type
The node's type.
|
Constructor and Description |
---|
FlowNode(int id,
java.lang.String type)
Create an instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addExit(FlowNode node)
Add a node as an exit for this node.
|
void |
addExits(java.util.Set<FlowNode> exits)
Add one or more nodes as exits for this node.
|
boolean |
equals(java.lang.Object obj)
Check if this instance is the same as the other one (if
id is the same). |
java.util.Set<FlowNode> |
exits()
Get all the exits node (nodes associated with node(s) which will be reached once this block
has finished).
|
int |
getDepth()
Get the node's
depth . |
java.lang.Integer |
getGroupId()
Get the node's
groupId . |
int |
getId()
Get the node's
id . |
int |
getOrder()
Get the node's
order . |
java.lang.Integer |
getParentId()
Get the node's
parentId . |
java.lang.String |
getText()
Get the node's
text . |
java.lang.String |
getType()
Get the node's
type . |
int |
hashCode()
Compute the unique hashcode for this instance, using the
id . |
boolean |
isLoop()
Get the
loop flag. |
void |
setDepth(int depth)
Set the node's
depth . |
void |
setGroupId(java.lang.Integer groupId)
Set the node's
groupId . |
void |
setId(int id)
Set the node's
id . |
void |
setLoop(boolean loop)
Set the
loop flag. |
void |
setOrder(int order)
Set the node's
order . |
void |
setParentId(java.lang.Integer parentId)
Set the node's
parentId . |
void |
setText(java.lang.String text)
Set the node's
text . |
void |
setType(java.lang.String type)
Set the node's
type . |
private int id
private java.lang.String type
private java.lang.String text
private int depth
private int order
private java.lang.Integer parentId
private java.lang.Integer groupId
private boolean loop
private java.util.Set<FlowNode> exits
public FlowNode(int id, java.lang.String type)
id
- The node's ID.type
- The node's type.public int getId()
id
.public void setId(int id)
id
.id
- The node's id.public java.lang.String getType()
type
.public void setType(java.lang.String type)
type
.type
- The node's type.public java.lang.String getText()
text
.public void setText(java.lang.String text)
text
.text
- The node's text.public int getDepth()
depth
.public void setDepth(int depth)
depth
.depth
- The node's depth.public int getOrder()
order
.public void setOrder(int order)
order
.order
- The node's order.public java.lang.Integer getParentId()
parentId
. May be null
.public void setParentId(java.lang.Integer parentId)
parentId
.parentId
- The parent ID.public java.lang.Integer getGroupId()
groupId
. May be null
.public void setGroupId(java.lang.Integer groupId)
groupId
.groupId
- The group ID.public boolean isLoop()
loop
flag. Marks nodes associated with a loop execution.true
if this node is associated with a loop execution.public void setLoop(boolean loop)
loop
flag. Marks nodes associated with a loop execution.loop
- The loop state.public java.util.Set<FlowNode> exits()
public void addExit(FlowNode node)
node
- The exit node.public void addExits(java.util.Set<FlowNode> exits)
exits
- The exit nodes.public boolean equals(java.lang.Object obj)
id
is the same).equals
in class java.lang.Object
obj
- The instance to compare.public int hashCode()
id
.hashCode
in class java.lang.Object