1 package cz.cuni.amis.pogamut.shady;
2
3 import cz.cuni.amis.pogamut.sposh.exceptions.MissingRootException;
4 import java.util.Collections;
5 import java.util.List;
6
7
8
9
10
11 public class ShadeTree {
12 public final static String ROOT = "root";
13 private final List<ShadeNode> nodesUm;
14
15
16
17
18
19 ShadeTree(List<ShadeNode> nodes) {
20 this.nodesUm = Collections.unmodifiableList(nodes);
21 }
22
23
24
25
26
27 public ShadeNode getRoot() {
28 for (ShadeNode node : nodesUm)
29 if (ROOT.equals(node.getName()))
30 return node;
31 throw new MissingRootException(ROOT);
32 }
33
34
35
36
37
38
39 public ShadeNode findNode(String name) {
40 throw new UnsupportedOperationException("Not yet implemented");
41 }
42 }