View Javadoc

    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       public StartOrEndDataFlowNode(LinkedList dataFlow, int line, boolean isStartNode) {
    10          this.dataFlow = dataFlow;
    11          if (!this.dataFlow.isEmpty()) {
    12              DataFlowNode parent = (DataFlowNode) this.dataFlow.getLast();
    13              parent.addPathToChild(this);
    14          }
    15          this.dataFlow.addLast(this);
    16          this.line = line;
    17          this.isStartNode = isStartNode;
    18      }
    19
    20      public String toString() {
    21          return isStartNode ? "Start node" : "End node";
    22      }
    23  }