Class LblTree
- java.lang.Object
-
- javax.swing.tree.DefaultMutableTreeNode
-
- com.crawljax.stateabstractions.dom.RTED.LblTree
-
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<Object>,MutableTreeNode,TreeNode
public class LblTree extends DefaultMutableTreeNode implements Comparable<Object>
A node of a tree. Each tree has an ID. The label can be empty, but can not contain trailing spaces (nor consist only of spaces). Two nodes are equal, if there labels are equal, and n1 < n2 if label(n1) < label(n2).- Author:
- Nikolaus Augsten from approxlib, available at http://www.inf.unibz.it/~augsten/src/ modified by Mateusz Pawlik
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringBRANCH_STRINGstatic StringCLOSE_BRACKETstatic intHIDE_ALL_LABELSstatic intHIDE_NOTHINGstatic intHIDE_ROOT_LABELstatic StringID_SEPARATOR(package private) StringlabelintNO_NODEno node idintNO_TREE_IDno tree id is defined(package private) intnodeIDstatic StringOPEN_BRACKETstatic intRANDOM_ROOT_LABELstatic intRENAME_LABELS_TO_LEVELstatic StringROOT_STRINGprivate static longserialVersionUIDstatic StringTAB_STRING(package private) ObjecttmpData(package private) inttreeID-
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearTmpData()Clear tmpData in subtree rooted in this node.intcompareTo(Object o)Compares the labels.StringgetLabel()intgetNodeCount()ObjectgetTmpData()intgetTreeID()voidprettyPrint()voidprettyPrint(boolean printTmpData)voidsetLabel(String label)voidsetTmpData(Object tmpData)tmpData: Hook for any data that a method must attach to a tree.voidsetTreeID(int treeID)StringtoString()String representation of a tree.-
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, getPathToRoot, 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
-
-
-
-
Field Detail
-
TAB_STRING
public static final String TAB_STRING
- See Also:
- Constant Field Values
-
ROOT_STRING
public static final String ROOT_STRING
- See Also:
- Constant Field Values
-
BRANCH_STRING
public static final String BRANCH_STRING
- See Also:
- Constant Field Values
-
OPEN_BRACKET
public static final String OPEN_BRACKET
- See Also:
- Constant Field Values
-
CLOSE_BRACKET
public static final String CLOSE_BRACKET
- See Also:
- Constant Field Values
-
ID_SEPARATOR
public static final String ID_SEPARATOR
- See Also:
- Constant Field Values
-
HIDE_NOTHING
public static final int HIDE_NOTHING
- See Also:
- Constant Field Values
-
HIDE_ROOT_LABEL
public static final int HIDE_ROOT_LABEL
- See Also:
- Constant Field Values
-
RENAME_LABELS_TO_LEVEL
public static final int RENAME_LABELS_TO_LEVEL
- See Also:
- Constant Field Values
-
HIDE_ALL_LABELS
public static final int HIDE_ALL_LABELS
- See Also:
- Constant Field Values
-
RANDOM_ROOT_LABEL
public static final int RANDOM_ROOT_LABEL
- See Also:
- Constant Field Values
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
NO_NODE
public final int NO_NODE
no node id- See Also:
- Constant Field Values
-
NO_TREE_ID
public final int NO_TREE_ID
no tree id is defined- See Also:
- Constant Field Values
-
treeID
int treeID
-
label
String label
-
tmpData
Object tmpData
-
nodeID
int nodeID
-
-
Constructor Detail
-
LblTree
public LblTree(String label, int treeID)
Use only this constructor!
-
-
Method Detail
-
getLabel
public String getLabel()
-
setLabel
public void setLabel(String label)
-
getTreeID
public int getTreeID()
-
setTreeID
public void setTreeID(int treeID)
-
getTmpData
public Object getTmpData()
-
setTmpData
public void setTmpData(Object tmpData)
tmpData: Hook for any data that a method must attach to a tree. Methods can assume, that this date is null and should return it to be null!
-
prettyPrint
public void prettyPrint()
-
prettyPrint
public void prettyPrint(boolean printTmpData)
-
getNodeCount
public int getNodeCount()
-
toString
public String toString()
String representation of a tree.- Overrides:
toStringin classDefaultMutableTreeNode- Returns:
- string representation of this tree
-
compareTo
public int compareTo(Object o)
Compares the labels.- Specified by:
compareToin interfaceComparable<Object>
-
clearTmpData
public void clearTmpData()
Clear tmpData in subtree rooted in this node.
-
-