public abstract class TreeNode extends NodeBase
emptyNodeArray, parent
UNKNOWN
Constructor and Description |
---|
TreeNode()
Constructor.
|
TreeNode(int size)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(NodeBase child)
Add the node as a child.
|
void |
addChild(NodeBase child,
int position) |
protected void |
addChildInOrder(NodeBase newChild,
boolean fillInOffsets)
Add the node as a child, making sure it's in offset order with the other
children.
|
protected void |
addChildPostNormalize(NodeBase child)
Add the node as a child after normalization has occurred.
|
protected void |
addTemporaryChild(NodeBase child)
Adds a node to the list of children WITHOUT changing their real parent.
|
IASNode |
getChild(int i)
Get a particular child of this node
|
int |
getChildCount()
Get the number of children
|
protected int |
getInitialChildCount()
Take a guess as to an efficient initial child count.
|
void |
normalize(boolean fillInOffsets)
Normalize the tree.
|
protected void |
optimizeChildren(Object newChildren)
Sets our children to an optimized version of newChildren.
|
void |
removeAllChildren()
Removes all of the children of this node
|
protected void |
removeChild(NodeBase child)
Remove the node as a child.
|
protected void |
removeTemporaryChild(NodeBase child)
Removes a node from the list of children WITHOUT changing their real
parent.
|
protected void |
replaceChild(NodeBase child,
NodeBase target)
Replaces the child with the given target.
|
protected void |
sortChildren(boolean updateBounds) |
protected void |
swapChildren(NodeBase child,
NodeBase target)
Changes the position of two children in our tree.
|
analyze, buildInnerString, buildStringRecursive, canContinueContainmentSearch, collectImportNodes, combineAttributes, connectedToProjectScope, contains, endAfter, endAfter, endBefore, endBefore, fillInOffsets, getAbsoluteEnd, getAbsoluteStart, getAncestorOfType, getASScope, getContainingFilePath, getContainingNode, getContainingScope, getEnd, getFileScope, getFileSpecification, getInnerString, getNodeKind, getPackageName, getParent, getScopeNode, getSpanningStart, getStart, getSucceedingNode, getWorkspace, isTerminal, isTransparent, looselyContains, runPostProcess, setChildren, setParent, span, span, span, startAfter, startAfter, startBefore, startBefore, toString, tryGetOffsetLookup, verify
getColumn, getEndColumn, getEndLine, getLine, getLineColumnString, getOffsetsString, getSourcePath, getSourcePathString, setColumn, setEnd, setEndColumn, setEndLine, setLine, setSourceLocation, setSourcePath, setStart, span, span
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getColumn, getEndColumn, getEndLine, getLine, getSourcePath
public TreeNode()
public TreeNode(int size)
size
- The initial size of the array containing the children.public int getChildCount()
IASNode
getChildCount
in interface IASNode
getChildCount
in class NodeBase
public IASNode getChild(int i)
IASNode
protected void replaceChild(NodeBase child, NodeBase target)
NodeBase
replaceChild
in class NodeBase
child
- the NodeBase
to replacetarget
- the NodeBase
to replace the replacedprotected void swapChildren(NodeBase child, NodeBase target)
NodeBase
swapChildren
in class NodeBase
child
- the child to replace targettarget
- the child to replace childpublic void normalize(boolean fillInOffsets)
NodeBase
protected int getInitialChildCount()
public void addChild(NodeBase child)
child
- child node to addpublic void addChild(NodeBase child, int position)
protected void addChildPostNormalize(NodeBase child)
child
- child node to addprotected void addChildInOrder(NodeBase newChild, boolean fillInOffsets)
newChild
- child node to addfillInOffsets
- true if we should fill in offsets as we goprotected void addTemporaryChild(NodeBase child)
child
- new child nodeprotected void removeChild(NodeBase child)
child
- child node to removeprotected void removeTemporaryChild(NodeBase child)
child
- new child nodepublic void removeAllChildren()
protected void optimizeChildren(Object newChildren)
newChildren
- protected void sortChildren(boolean updateBounds)
Copyright © 2016 The Apache Software Foundation. All rights reserved.