|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.tree.DefaultMutableTreeNode
proper.database.JoinTreeNode
public class JoinTreeNode
A specialized TreeNode class that handles Join-Objects and provides some
methods for conveniencs.
Note: the root node is just a table, since it doesn't join with any other
table to the left.
Field Summary |
---|
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
---|
EMPTY_ENUMERATION |
Constructor Summary | |
---|---|
JoinTreeNode()
initializes the node with no Join |
|
JoinTreeNode(Join j)
initializes the node with the given Join |
|
JoinTreeNode(java.lang.String s)
initializes the node with the given string (can be either a Table or a Join-Definition) |
|
JoinTreeNode(Table t)
initializes the node with the given Table (only for the root element!) |
Method Summary | |
---|---|
java.util.Vector |
getAllJoins()
returns a vector with all the Joins in the subtree, including this node (depth-first) |
java.util.Vector |
getAllNodes()
returns all the nodes in the subtree including this node (depth-first) |
java.util.Vector |
getAllTables()
returns a vector with all the Tables in the subtree, including this node (depth-first) |
Join |
getChildJoinAt(int index)
returns the Join of the specified child |
Join |
getJoin()
returns the Join object of this node, null if not a Join object stored |
java.util.Vector |
getJoinsAlongPath()
returns all the Joins (as string representations) that are along the path to the root. Note: the root is a Table element! |
Table |
getTable()
returns the Table object of this node, null if not a Table object stored |
java.util.Vector |
getTablesAlongPath()
returns all the Tables that are along the path to the root |
boolean |
isInPath(Join j)
checks whether the given Join is somewhere on the path to the root |
boolean |
isJoin()
checks whether we have a Join object as userobject |
boolean |
isTable()
checks whether we have a Table object as userobject (as root element) |
static void |
main(java.lang.String[] args)
for testing only |
static JoinTreeNode |
parseTreeString(java.lang.String tree)
parses the given tree in string representation and returns it in a TreeNode Structure, e.g.: |
void |
setJoin(Join j)
sets the Join |
void |
setTable(Table t)
sets the Table |
java.lang.String |
toString()
returns the name of the table |
java.lang.String |
toString(boolean all)
returns either the whole subtree (including itself) as a string representation (= TRUE) or only the table (= FALSE) |
java.lang.String |
toTreeString()
returns itself and the subtree underneath in a string representation that can be parsed with the parseTree(String) method |
java.lang.String |
toTreeString(boolean full)
returns itself and the subtree underneath in a string representation that can be parsed with the parseTree(String) method |
static java.lang.String |
toTreeString(JoinTreeNode node)
returns the node and the subtree underneath in a string representation that can be parsed with the parseTree(String) method |
static java.lang.String |
toTreeString(JoinTreeNode node,
boolean full)
returns the node and the subtree underneath in a string representation that can be parsed with the parseTree(String) method |
void |
updateChildren()
in case the name of the table changed, all the children Joins will be updated. |
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode |
---|
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JoinTreeNode()
public JoinTreeNode(Join j)
public JoinTreeNode(Table t)
public JoinTreeNode(java.lang.String s)
Join.parseString(String)
Method Detail |
---|
public void setJoin(Join j)
public void setTable(Table t)
public boolean isJoin()
public boolean isTable()
public Join getJoin()
public Table getTable()
public Join getChildJoinAt(int index)
public boolean isInPath(Join j)
public java.util.Vector getJoinsAlongPath()
Join.parseString(String)
public java.util.Vector getTablesAlongPath()
public java.util.Vector getAllNodes()
public java.util.Vector getAllJoins()
public java.util.Vector getAllTables()
public void updateChildren()
public static JoinTreeNode parseTreeString(java.lang.String tree)
a[b,c[d,e]]represents the following tree:
a |-b |-c | |-d | |-e
toTreeString()
,
toTreeString(boolean)
public java.lang.String toTreeString()
parseTree(String)
method
parseTreeString(String)
public java.lang.String toTreeString(boolean full)
parseTree(String)
method
full
- whether to print columns, sizes, etc in parenthesesparseTreeString(String)
public static java.lang.String toTreeString(JoinTreeNode node)
parseTree(String)
method
node
- the node to represent in String notationparseTreeString(String)
public static java.lang.String toTreeString(JoinTreeNode node, boolean full)
parseTree(String)
method
node
- the node to get the string notation fromfull
- whether to print columns, sizes, etc in parenthesesparseTreeString(String)
public java.lang.String toString()
toString
in class javax.swing.tree.DefaultMutableTreeNode
public java.lang.String toString(boolean all)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |