1 package cz.cuni.amis.pogamut.shady;
2
3 import java.util.Collections;
4 import java.util.List;
5
6 /**
7 * Representation of one node in the if-then tree. The root node is always
8 * called "root" and all nodes must have different names.
9 * @author Honza
10 */
11 public class ShadeNode {
12
13 private final String name;
14 private final String descr;
15 private final List<NodeElement> elementsUm;
16
17 /**
18 * Create new node with specified name, description and elements.
19 * @param name name of the node, used in {@link NodeCall}
20 * @param descr description of this node, what is what and so on
21 * @param elements elements of this node, possible paths engine can choose
22 * when it descends into this node. Elements are evaluated using
23 * priority and trigger until the one with highest priority and
24 * enabled trigger is selected.
25 */
26 ShadeNode(String name, String descr, List<NodeElement> elements) {
27 this.name = name;
28 this.descr = descr;
29 this.elementsUm = Collections.unmodifiableList(elements);
30 }
31
32 /**
33 * Get identifier of the node. That has some special rules and is quite
34 * similar to FQN name of class.
35 * @return identifier of node.
36 */
37 public String getName() {
38 return name;
39 }
40
41 /**
42 * Get list of all elements of this node.
43 * @return unmodifiable list
44 */
45 public List<NodeElement> getElements() {
46 return elementsUm;
47 }
48
49 }