NodeType
- graph node type.EdgeType
- graph edge type.TransformerType
- transformer type. Transformer instances can be used
to change the graph and its underlying representation to apply
optimizations.public interface Graph<NodeType,EdgeType,TransformerType>
Modifier and Type | Method and Description |
---|---|
Object |
getEdgeData(EdgeType edge) |
NodeType |
getEnd(EdgeType edge)
Returns edge end node.
|
ArrayList<EdgeType> |
getGraphInEdges()
Returns graph incoming edges.
|
ArrayList<EdgeType> |
getGraphOutEdges()
Returns graph outgoing edges.
|
List<EdgeType> |
getInEdges(NodeType n)
Returns edges coming into node.
|
ArrayList<NodeType> |
getNodes()
Returns all nodes in the graph.
|
List<EdgeType> |
getOutEdges(NodeType node)
Returns edges originating from the node.
|
NodeType |
getStart(EdgeType edge)
Returns edge start node.
|
String |
print()
Returns string representation of the graph.
|
<A extends Assumption<A>> |
printWithAssumptions(Map<EdgeType,A> assumptions)
Returns string representation of the graph with all assumptions along its
edges.
|
void |
setEdgeData(EdgeType edge,
Object data) |
boolean |
transform(NodeType node,
TransformerType transformer)
Transforms the node with transformer.
|
String print()
<A extends Assumption<A>> String printWithAssumptions(Map<EdgeType,A> assumptions)
boolean transform(NodeType node, TransformerType transformer)
true
if there were changes made by transformer. While
transformation should be always sound, it might be impossible to apply
it in current context due to complexities of underlying structures. E.g.
it is impossible to delete if statement test expression, while it is not
evaluated if statement is not reachable. In this case transformer can
return false
and do no changes.Copyright © 2018. All rights reserved.