01: package net.sourceforge.pmd.dfa;
02:
03: import java.util.LinkedList;
04:
05: public class StartOrEndDataFlowNode extends DataFlowNode {
06:
07: private boolean isStartNode;
08:
09: public StartOrEndDataFlowNode(LinkedList<DataFlowNode> dataFlow,
10: int line, boolean isStartNode) {
11: this .dataFlow = dataFlow;
12: if (!this .dataFlow.isEmpty()) {
13: DataFlowNode parent = this .dataFlow.getLast();
14: parent.addPathToChild(this );
15: }
16: this .dataFlow.addLast(this );
17: this .line = line;
18: this .isStartNode = isStartNode;
19: }
20:
21: public String toString() {
22: return isStartNode ? "Start node" : "End node";
23: }
24: }
|