1 package com.sri.emo.dbobj.model_tree;
2
3 import java.util.Iterator;
4
5
6 /***
7 * This represents the 'public' interface for traversing the model and
8 * reading it. It does not consider mutability since that is really
9 * for the consideration of the model builder only. Look at {@link MutableModelNode}
10 * if you need for some reason to modify the model at runtime.
11 *
12 * @author Michael Rimov
13 */
14 public interface Model {
15
16
17 /***
18 * Allows for the client to visit the nodes one-by-one.
19 *
20 * @return Iterator
21 */
22 Iterator iterator();
23
24
25 /***
26 * Allows for client to visit the nodes one-by-one but still engage
27 * in the semantics of tree traversal by firing an event whenever a 'level'
28 * in the tree is entered and exited.
29 *
30 * @param eventListener TreeTraversalListener the target for the events
31 * @return Iterator
32 */
33 Iterator iterator(TreeTraversalListener eventListener);
34
35 /***
36 * Retrieves the root of the tree hierarchy to allow for manual
37 * manipulation if needed. Otherwise, use {@link #iterator}.
38 *
39 * @return ModelNode instance.
40 */
41 ModelNode getRoot();
42
43 }