Public Member Functions | |
Object | clone () |
boolean | equals (Object x) |
void | setNodeValue (Object v) |
void | setChild (int index, TermModel child) |
void | setChildren (TermModel[] c) |
TermModel[] | getChildren () |
void | addChildren (TermModel[] more) |
void | deleteChildren (int[] less) |
void | deleteChildren (TermModel[] less) |
void | assignToVar (VariableNode v, Object value) |
void | setRoot () |
void | setRoot (TermModel r) |
boolean | isRoot () |
String | getTemplate () |
String | getFunctorArity () |
Object | getRoot () |
Object | getChild (Object parent, int index) |
int | getChildCount (Object parent) |
boolean | isLeaf (Object node) |
void | valueForPathChanged (TreePath path, Object newValue) |
int | getIndexOfChild (Object parent, Object child) |
void | addTreeModelListener (TreeModelListener l) |
void | removeTreeModelListener (TreeModelListener l) |
Object | getChild (int index) |
int | getChildCount () |
boolean | isLeaf () |
void | addTermModelListener (TermModelListener l) |
void | removeTermModelListener (TermModelListener l) |
void | fireTermChanged () |
TermModel () | |
TermModel (Object n) | |
TermModel (Object n, TermModel[] c) | |
TermModel (Object n, Vector v) | |
Vector | makeIntegerVector () |
int | intValue () |
String | toString () |
String | toString (PrologOperatorsContext ops) |
String | listToString (PrologOperatorsContext ops) |
boolean | isListEnd () |
boolean | isList () |
boolean | isAtom () |
boolean | isNumber () |
boolean | isInteger () |
boolean | isVar () |
boolean | nodeIsVar () |
TermModel[] | flatList () |
Static Public Member Functions | |
static ObjectExamplePair | example () |
static TreePath | findPathForNode (String label, TermModel tree, boolean exactMatch) |
static TermModel | makeList (TermModel[] terms) |
static TermModel | makeList (Vector terms) |
static TermModel[] | flatList (TermModel list) |
static Hashtable | props2Hashtable (TermModel[] terms) |
Data Fields | |
Object | node |
TermModel[] | children |
transient TermModel | root |
Static Public Attributes | |
static final int | listMaxLength = 100 |
Protected Member Functions | |
void | propagateRoot () |
Static Protected Member Functions | |
static TermModel | makeList (int t, TermModel[] terms) |
static TermModel | makeList (int t, Vector terms) |
Static Package Functions | |
static boolean | inArray (int x, int[] a) |
static boolean | inArray (Object x, Object[] a) |
static boolean | foundPathForNode (String label, TermModel tree, boolean exactMatch, Vector bag) |
static void | flatList (TermModel x, Vector bag) |
Static Package Attributes | |
static PrologOperatorsContext | defaultOperatorContext = new PrologOperatorsContext() |
Definition at line 20 of file TermModel.java.
|
Add children to this term node; a new children array is created and old children are copied to it Definition at line 101 of file TermModel.java. References children, getChildCount(), and setChildren(). |
|
Start notifying listener l of changes to this term. The term is considered changed iff either a node or children is set to a different object; a nonreported change is the setting of a same object as node/children, not the setting of an "equals" object Definition at line 252 of file TermModel.java. References isRoot(). |
|
Definition at line 228 of file TermModel.java. |
|
Replaces all occurrences of v in this subterm by value, using setNodeValue Definition at line 150 of file TermModel.java. References node, and setNodeValue(). |
|
Clones by serialization, to keep variable bindings; these should form a closed graph within this term, otherwise the new term instance would contain dangling references Definition at line 43 of file TermModel.java. |
|
Removes the children in array; it finds children to remove by using the equivalent of Prolog's == Definition at line 125 of file TermModel.java. References children, getChildCount(), inArray(), and setChildren(). |
|
Delete children with specified indexes; a new children array is created and old children are copied to it Definition at line 112 of file TermModel.java. References children, getChildCount(), inArray(), and setChildren(). |
|
True if both terms are structurally similar with equal nodes Definition at line 59 of file TermModel.java. References getChild(), getChildCount(), and node. Referenced by isList(). |
|
Flattens a list into a TermModel array, but not completely: the result may still contain lists Definition at line 449 of file TermModel.java. |
|
Flattens this list into a new TermModel array, but not completely: the result may still contain lists Definition at line 443 of file TermModel.java. |
|
Definition at line 202 of file TermModel.java. Referenced by equals(), foundPathForNode(), and getChild(). |
|
Definition at line 206 of file TermModel.java. Referenced by equals(), foundPathForNode(), com::declarativa::interprolog::gui::PredicateTableModel::PredicateTableModel(), and props2Hashtable(). |
|
Return a node/arity String Definition at line 191 of file TermModel.java. References getChildCount(), and node. |
|
Definition at line 220 of file TermModel.java. |
|
Definition at line 198 of file TermModel.java. |
|
Return a Node(_,..._) String Definition at line 179 of file TermModel.java. References getChildCount(), and node. |
|
Returns node object as an int, assuming it is a Number Definition at line 356 of file TermModel.java. |
|
Definition at line 212 of file TermModel.java. References getChildCount(). Referenced by props2Hashtable(). |
|
This node is its own root Definition at line 171 of file TermModel.java. References root. Referenced by addTermModelListener(), and fireTermChanged(). |
|
Assuming this is a list of numbers, returns a Vector containing one Integer for each number in the list Definition at line 347 of file TermModel.java. |
|
Definition at line 233 of file TermModel.java. |
|
Set the child, notifying TermModelListeners Definition at line 83 of file TermModel.java. References children, and fireTermChanged(). |
|
Set the children array, notifying TermModelListeners Definition at line 90 of file TermModel.java. References children, and fireTermChanged(). Referenced by addChildren(), and deleteChildren(). |
|
Set the node, notifying TermModelListeners Definition at line 70 of file TermModel.java. References fireTermChanged(), and node. Referenced by assignToVar(). |
|
Set the root variables of nodes in this subterm to refer r as their root Definition at line 164 of file TermModel.java. References propagateRoot(), and root. |
|
Set the root variables of nodes in this subterm to refer this term node as their root Definition at line 159 of file TermModel.java. Referenced by propagateRoot(). |
|
Definition at line 216 of file TermModel.java. |
|
public for convenience, but should not be set outside this class; children == null means children == new TermModel[0] Definition at line 25 of file TermModel.java. Referenced by addChildren(), deleteChildren(), getChildren(), com::declarativa::interprolog::gui::PredicateTableModel::getValueAt(), listToString(), propagateRoot(), props2Hashtable(), setChild(), and setChildren(). |
|
public for convenience, but should not be set outside this class Definition at line 22 of file TermModel.java. Referenced by assignToVar(), equals(), foundPathForNode(), getFunctorArity(), getTemplate(), com::declarativa::interprolog::gui::TermTreeCellRenderer::getTreeCellRendererComponent(), com::declarativa::interprolog::gui::PredicateTableModel::PredicateTableModel(), props2Hashtable(), setNodeValue(), and com::declarativa::interprolog::gui::TermTreeModel::topList(). |
|
The TermModel containing this; relevant to define variable scope. For this to contain the root, the root TermModel must have been messaged once with setRoot() Definition at line 30 of file TermModel.java. Referenced by fireTermChanged(), isRoot(), propagateRoot(), and setRoot(). |