KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > graph > def > NodeCollection


1 package org.jbpm.graph.def;
2
3 import java.io.Serializable JavaDoc;
4 import java.util.*;
5
6 /**
7  * is a common supertype for a ProcessDefinition and a SuperState.
8  */

9 public interface NodeCollection extends Serializable JavaDoc {
10   
11   /**
12    * is the ordered list of nodes.
13    */

14   List getNodes();
15
16   /**
17    * maps node-names to nodes. returns an empty map if
18    * no nodes are contained.
19    */

20   Map getNodesMap();
21
22   /**
23    * retrieves a node by name.
24    * @return the node or null if no such node is present.
25    */

26   Node getNode(String JavaDoc name);
27   
28   /**
29    * is true if this node-collection contains a node with the
30    * given name, false otherwise.
31    */

32   boolean hasNode(String JavaDoc name);
33
34   /**
35    * adds the given node to this node-collection.
36    * @return the added node.
37    * @throws IllegalArgumentException if node is null.
38    */

39   Node addNode(Node node);
40
41   /**
42    * removes the given node from this node-collection.
43    * @return the removed node or null if the node was not present in this collection.
44    * @throws IllegalArgumentException if node is null or if the node is not contained in this nodecollection.
45    */

46   Node removeNode(Node node);
47
48   /**
49    * changes the order of the nodes : the node on oldIndex
50    * is removed and inserted in the newIndex. All nodes inbetween
51    * the old and the new index shift one index position.
52    * @throws IndexOutOfBoundsException
53    */

54   void reorderNode(int oldIndex, int newIndex);
55
56   /**
57    * generates a new name for a node to be added to this collection.
58    */

59   String JavaDoc generateNodeName();
60   
61   /**
62    * finds the node by the given hierarchical name. use .. for
63    * the parent, use slashes '/' to separate the node names.
64    */

65   Node findNode(String JavaDoc hierarchicalName);
66 }
67
Popular Tags