Interface ITaskFlowAnalysisData
-
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
ITaskFlowAnalysis
public interface ITaskFlowAnalysisData extends Serializable
Base data with the result of analyzing a workflow task, without analysis operations. Contains the end points, the hierarchy graph, and the created flow graph.- Since:
- 8.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <K,V>
Vassociate(K key, Function<K,V> computeValue)
Associates and returns a value with a given key.IFlowGraphEndPoints
getEndPoints(NodeKey node)
Theend points
of the given node.com.google.common.graph.Graph<NodeKey>
getHierarchyGraph()
Returns a directed graph with all nodes and an edge from the parent to the child.IFlowGraphEndPoints
getRootEndPoints()
Theend points
of theroot node
.com.google.common.graph.ValueGraph<NodeKey,? extends IFlowGraphEdgeData>
getValueFlowGraph()
Returns the flow graph that indicated potential successors for each node.com.google.common.collect.ImmutableMap<NodeKey,IVirtualFlowGraphNode>
getVirtualNodes()
An index with allvirtual
flow graph nodes that were introduced into the graph.default boolean
isRealNode(INodeKeyProviding nodeKey)
Checks whether the given node is a realWorkflowNode
, seeIVirtualFlowGraphNode
andgetVirtualNodes()
for more details.default boolean
isRealNode(NodeKey nodeKey)
Checks whether the given node is a realWorkflowNode
, seeIVirtualFlowGraphNode
andgetVirtualNodes()
for more details.default boolean
isVirtualNode(INodeKeyProviding nodeKey)
Checks whether the given node is a virtual node, seeIVirtualFlowGraphNode
andgetVirtualNodes()
for more details.default boolean
isVirtualNode(NodeKey nodeKey)
Checks whether the given node is a virtual node, seeIVirtualFlowGraphNode
andgetVirtualNodes()
for more details.NodeKey
resolveToRealNode(NodeKey nodeKey)
Resolves a node key to a realWorkflowNode
in the flow graph.
-
-
-
Method Detail
-
associate
<K,V> V associate(K key, Function<K,V> computeValue)
Associates and returns a value with a given key. Both the key and the value should beSerializable
. The value is bound to the lifetime of this flow analysis. Ensures that the value is computed only once and reused during subsequent calls with the same key to this method.- Type Parameters:
K
- Type of the key with which to associate a value.V
- Type of the value to associate with the key.- Parameters:
key
- Key with which to associate a value. Must beSerializable
and must implementObject.equals(Object)
andObject.hashCode()
in an appropriate manner.computeValue
- Computes the value for a given key, when no value was yet associated with a key.- Returns:
- The value for the given key.
-
getEndPoints
IFlowGraphEndPoints getEndPoints(NodeKey node)
Theend points
of the given node. Can be used, for example, to check, if all code paths have a return statement or end abruptly. (which is the case if no normal end points exist). See the sub classes ofFlowGraphEndPoint
for more details regarding end points.- Parameters:
node
- Node for which to find the end points.- Returns:
- The end points of the given node. Never
null
, but might be empty if a non-existing node was given.
-
getHierarchyGraph
com.google.common.graph.Graph<NodeKey> getHierarchyGraph()
Returns a directed graph with all nodes and an edge from the parent to the child.Note:
IVirtualFlowGraphNode
are not present in the hierarchy graph, as they are not part of the syntax tree.- Returns:
- A graph representing the hierarchy of the nodes.
-
getRootEndPoints
IFlowGraphEndPoints getRootEndPoints()
Theend points
of theroot node
. Can be used, for example, to check, if all code paths have a return statement or end abruptly. (which is the case if no normal end points exist). See the sub classes ofFlowGraphEndPoint
for more details regarding end points.- Returns:
- The end points of the root node.
-
getValueFlowGraph
com.google.common.graph.ValueGraph<NodeKey,? extends IFlowGraphEdgeData> getValueFlowGraph()
Returns the flow graph that indicated potential successors for each node. The flow graph is a directed graph with one edge for each node contained in the analyzed task. The graph has an edge fromnode1
tonode2
iff is is possible thatnode1
transfers control directly tonode2
; i.e. iff there exists at least one code path wherenode2
immediately succeedsnode1
.In addition, each edge has additional data with information about that edge, see
IFlowGraphEdgeData
.- Returns:
- The flow graph that was obtained from analyzing the task.
- Since:
- 8.0.0
-
getVirtualNodes
com.google.common.collect.ImmutableMap<NodeKey,IVirtualFlowGraphNode> getVirtualNodes()
An index with allvirtual
flow graph nodes that were introduced into the graph.- Returns:
- A map with all virtual nodes, indexed by their node key.
- Since:
- 8.1.0
-
isRealNode
default boolean isRealNode(INodeKeyProviding nodeKey)
Checks whether the given node is a realWorkflowNode
, seeIVirtualFlowGraphNode
andgetVirtualNodes()
for more details.- Parameters:
nodeKey
- Key of a node to check- Returns:
- Whether the given key refers to a real node.
- Since:
- 8.1.0
-
isRealNode
default boolean isRealNode(NodeKey nodeKey)
Checks whether the given node is a realWorkflowNode
, seeIVirtualFlowGraphNode
andgetVirtualNodes()
for more details.- Parameters:
nodeKey
- Key of a node to check- Returns:
- Whether the given key refers to a real node.
- Since:
- 8.1.0
-
isVirtualNode
default boolean isVirtualNode(INodeKeyProviding nodeKey)
Checks whether the given node is a virtual node, seeIVirtualFlowGraphNode
andgetVirtualNodes()
for more details.- Parameters:
nodeKey
- Key of a node to check- Returns:
- Whether the given key refers to a virtual node.
- Since:
- 8.1.0
-
isVirtualNode
default boolean isVirtualNode(NodeKey nodeKey)
Checks whether the given node is a virtual node, seeIVirtualFlowGraphNode
andgetVirtualNodes()
for more details.- Parameters:
nodeKey
- Key of a node to check- Returns:
- Whether the given key refers to a virtual node.
- Since:
- 8.1.0
-
resolveToRealNode
NodeKey resolveToRealNode(NodeKey nodeKey)
Resolves a node key to a realWorkflowNode
in the flow graph. A flow graph may contain real nodes andvirtual nodes
. If the given node key points to a real node, that node is returned. If it points to avirtual node
, the virtual node'sowner
is returned. If it points to non-existing node, the given node key is simply returned as-is.- Parameters:
nodeKey
- Node key to resolve.- Returns:
- A node key pointing to a real node.
- Since:
- 8.1.0
-
-