|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Tree
Container for a rooted tree structure (hierarchy).
A tree is a table that maintains its topological information stored as four columns. An index represents a node number, with all associated values stored in the columns. The four internal columns are:
The root of a Tree is always at index 0 so a tree is never empty, it always contain at least a root.
Field Summary | |
---|---|
static int |
ROOT
Value of the tree's ROOT. |
static String |
TREE_METADATA
Metadata to get the tree from the table. |
Fields inherited from interface infovis.Table |
---|
FILTER_COLUMN, INTERNAL_PREFIX, NIL, SELECTION_COLUMN |
Fields inherited from interface infovis.metadata.Constants |
---|
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRITION, FORMAT, IDENTIFIER, LANGUAGE, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, TYPE |
Method Summary | |
---|---|
int |
addNode(int par)
Adds a node to the tree. |
RowIterator |
childrenIterator(int node)
Returns the iterator over the children of a node. |
int |
getChild(int node,
int index)
Returns the nth child of a node. |
int |
getChildCount(int node)
Returns the number of children of a node . |
int |
getDepth(int node)
Returns the depth of a node using either a depth column if it has been computed or the computeDepth method. |
int |
getNodeCount()
Returns the number of proper nodes in the Tree. |
int |
getParent(int node)
Returns the parent of a node. |
boolean |
isAncestor(int node,
int par)
Returns true if the first node has the second node as ancestor. |
boolean |
isLeaf(int node)
Returns true if the node is a leaf_node. |
int |
nextNode()
Returns the next node to be returned by addNode. |
boolean |
removeNode(int node)
Removes a node from the tree. |
void |
reparent(int node,
int newparent)
Change the parent of a specified node, changing the structure. |
Methods inherited from interface infovis.DynamicTable |
---|
addRow, removeRow |
Methods inherited from interface infovis.Table |
---|
addColumn, clear, getColumn, getColumnAt, getColumnCount, getLastRow, getRowCount, getTable, indexOf, indexOf, isRowValid, removeColumn, reverseIterator, setColumnAt |
Methods inherited from interface infovis.Column |
---|
addChangeListener, addValue, addValueOrNull, capacity, disableNotify, enableNotify, ensureCapacity, getFormat, getMaxIndex, getMinIndex, getName, getValueAt, getValueClass, hasUndefinedValue, isEmpty, isInternal, isValueUndefined, iterator, removeChangeListener, setFormat, setName, setSize, setValueAt, setValueOrNullAt, setValueUndefined, size |
Methods inherited from interface infovis.Metadata |
---|
getClientProperty, getMetadata |
Methods inherited from interface cern.colt.function.IntComparator |
---|
compare, equals |
Methods inherited from interface javax.swing.table.TableModel |
---|
addTableModelListener, getColumnClass, getColumnName, getValueAt, isCellEditable, removeTableModelListener, setValueAt |
Methods inherited from interface javax.swing.tree.TreeModel |
---|
addTreeModelListener, getChild, getChildCount, getIndexOfChild, getRoot, isLeaf, removeTreeModelListener, valueForPathChanged |
Field Detail |
---|
static final String TREE_METADATA
static final int ROOT
Method Detail |
---|
int getChild(int node, int index)
node
- the nodeindex
- the index if the requested child
int getParent(int node)
node
- the node
RowIterator childrenIterator(int node)
node
- the node
int addNode(int par)
par
- the parent of the node.
boolean removeNode(int node)
node
- the node to remove
int getNodeCount()
int nextNode()
void reparent(int node, int newparent)
node
- the node.newparent
- the new parent.boolean isAncestor(int node, int par)
node
- the node.par
- the tested ancestor.
int getDepth(int node)
node
- the node.
int getChildCount(int node)
node
.
node
- the node.
node
.boolean isLeaf(int node)
node
- the node
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |