1 |
| package net.sourceforge.pmd.dfa; |
2 |
| |
3 |
| import java.util.LinkedList; |
4 |
| |
5 |
| public class StartOrEndDataFlowNode extends DataFlowNode { |
6 |
| |
7 |
| private boolean isStartNode; |
8 |
| |
9 |
91
| public StartOrEndDataFlowNode(LinkedList dataFlow, int line, boolean isStartNode) {
|
10 |
91
| this.dataFlow = dataFlow;
|
11 |
91
| if (!this.dataFlow.isEmpty()) {
|
12 |
40
| DataFlowNode parent = (DataFlowNode) this.dataFlow.getLast();
|
13 |
40
| parent.addPathToChild(this);
|
14 |
| } |
15 |
91
| this.dataFlow.addLast(this);
|
16 |
91
| this.line = line;
|
17 |
91
| this.isStartNode = isStartNode;
|
18 |
| } |
19 |
| |
20 |
2
| public String toString() {
|
21 |
2
| return isStartNode ? "Start node" : "End node";
|
22 |
| } |
23 |
| } |