Closer to compiling. at the moment, it throws a NullPointerException right after...
[IRC.git] / Robust / src / Benchmarks / oooJava / DelaunayRefinement / Subgraph.java
1 public class Subgraph {
2
3   private final LinkedList nodes = new LinkedList();
4   private final LinkedList border = new LinkedList();
5   private final LinkedList edges = new LinkedList();
6
7   public Subgraph() {
8   }
9
10   public boolean existsNode(Node n) {
11     return nodes.contains(n);
12   }
13
14   public boolean existsBorder(Node b) {
15     return border.contains(b);
16   }
17
18   public boolean existsEdge(Edge_d e) {
19     return edges.contains(e);
20   }
21
22   public void addNode(Node n) {
23     nodes.addLast(n);
24   }
25
26   public void addBorder(Node b) {
27     border.addLast(b);
28   }
29
30   public void addEdge(Edge_d e) {
31     edges.addLast(e);
32   }
33
34   public LinkedList getNodes() {
35     return nodes;
36   }
37
38   public LinkedList getBorder() {
39     return border;
40   }
41
42   public LinkedList getEdges() {
43     return edges;
44   }
45
46   public void reset() {
47     nodes.clear();
48     border.clear();
49     edges.clear();
50   }
51
52   public HashSet newBad(EdgeGraph mesh) {
53     HashSet ret = new HashSet();
54     for (Iterator iter = nodes.iterator(); iter.hasNext();) {
55       Node node = (Node) iter.next();
56       Element element = (Element) mesh.getNodeData(node);
57       if (element.isBad())
58         ret.add(node);
59     }
60
61     return ret;
62   }
63 }