View Javadoc

1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.dfa;
5   
6   import java.util.LinkedList;
7   
8   public class StartOrEndDataFlowNode extends DataFlowNode {
9   
10      private boolean isStartNode;
11  
12      public StartOrEndDataFlowNode(LinkedList<DataFlowNode> dataFlow, int line, boolean isStartNode) {
13          this.dataFlow = dataFlow;
14          if (!this.dataFlow.isEmpty()) {
15              DataFlowNode parent = this.dataFlow.getLast();
16              parent.addPathToChild(this);
17          }
18          this.dataFlow.addLast(this);
19          this.line = line;
20          this.isStartNode = isStartNode;
21      }
22  
23      public String toString() {
24          return isStartNode ? "Start node" : "End node";
25      }
26  }