initial load
[DTRules.git] / DTRules / src / main / java / com / dtrules / trace / TraceNode.java
blob826ce5d1db3b89f99071b569aad064d1ef0720f2
1 /*
2 * $Id$
3 *
4 * Copyright 2004-2007 MTBJ, Inc.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
19 package com.dtrules.trace;
21 import com.dtrules.interpreter.RInteger;
22 import com.dtrules.interpreter.RName;
24 /**
25 * A trace node allows two kinds of navigation acorss changes recorded in
26 * a DTRules Trace file. One mode is a tree, and one mode is linear. In
27 * fact, all changes occur serially within a decision table thread. Yet all
28 * changes occur with in a hierarchy of Decision Table execution.
30 * The parent of all nodes is a root node. The initialization node holds the
31 * initial values (includeing data inserted into a ruleset)
33 * The changes are kept as nodes
35 public interface TraceNode {
37 /**
38 * These are the hierarchy operators.
41 /** getParent() -- return the parent node, usually a decisiontable. But it
42 * could be the root node, or the initialization node.
43 * @return
45 TraceNode getParent();
46 /**
47 * Get the firstChild()
48 * @return
50 TraceNode getFirstChild();
51 /**
52 * Get the next();
53 * Returns a null if no more children;
54 * @return
56 TraceNode getNext();
57 /**
58 * Get the perivious node,
59 * @return
61 TraceNode getPrevious();
63 /**
64 * These are the linear access methods. All the changes are organized
65 * in a linear list.
67 /**
68 * Get the next Change Node
69 * @return
71 TraceNode getNextChange();
72 /**
73 * Get the previous Change Node
74 * @return
76 TraceNode getPreviousChange();
79 /**
80 * Change Operators
82 void setOldValues();
83 void setNewValues();
84 /**
85 * Returns the Name for the Attribute that changed (or a null if
86 * this isn't a change to an Entity).
88 RName getAttribute();
89 /**
90 * Returns the index for the Attribute that changed (or a null if
91 * this isn't a change to an Element of an Array).
93 RInteger getIndex();