KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > pmd > dfa > StartOrEndDataFlowNode


1 package net.sourceforge.pmd.dfa;
2
3 import java.util.LinkedList JavaDoc;
4
5 public class StartOrEndDataFlowNode extends DataFlowNode {
6
7     private boolean isStartNode;
8
9     public StartOrEndDataFlowNode(LinkedList JavaDoc 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 JavaDoc toString() {
21         return isStartNode ? "Start node" : "End node";
22     }
23 }
24
Popular Tags