|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.template.soy.basetree.AbstractNode
com.google.template.soy.basetree.AbstractParentNode<N>
public abstract class AbstractParentNode<N extends Node>
Abstract implementation of a ParentNode.
Important: Do not use outside of Soy code (treat as superpackage-private).
| Field Summary |
|---|
| Fields inherited from class com.google.template.soy.basetree.AbstractNode |
|---|
SPACES |
| Constructor Summary | |
|---|---|
|
AbstractParentNode()
Constructor. |
protected |
AbstractParentNode(AbstractParentNode<N> orig)
Copy constructor. |
| Method Summary | |
|---|---|
void |
addChild(int index,
N child)
Adds the given child at the given index (shifting existing children if necessary). |
void |
addChild(N child)
Adds the given child. |
void |
addChildren(int index,
List<? extends N> children)
Adds the given children at the given index (shifting existing children if necessary). |
void |
addChildren(List<? extends N> children)
Adds the given children. |
void |
appendSourceStringForChildren(StringBuilder sb)
Appends the source strings for all the children to the given StringBuilder. |
void |
appendTreeStringForChildren(StringBuilder sb,
int indent)
Appends the tree strings for all the children to the given StringBuilder, at one further indentation level (3 spaces) than the given current indentation level. |
void |
clearChildren()
Clears the list of children. |
N |
getChild(int index)
Gets the child at the given index. |
int |
getChildIndex(N child)
Finds the index of the given child. |
List<N> |
getChildren()
Gets the list of children. |
int |
numChildren()
Gets the number of children. |
void |
removeChild(int index)
Removes the child at the given index. |
void |
removeChild(N child)
Removes the given child. |
void |
replaceChild(int index,
N newChild)
Replaces the child at the given index with the given new child. |
void |
replaceChild(N currChild,
N newChild)
Replaces the given current child with the given new child. |
String |
toTreeString(int indent)
Builds a string that visually shows the subtree rooted at this node (for debugging). |
| Methods inherited from class com.google.template.soy.basetree.AbstractNode |
|---|
clone, getNearestAncestor, getParent, hasAncestor, setParent, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.google.template.soy.basetree.Node |
|---|
clone, getNearestAncestor, getParent, hasAncestor, setParent, toSourceString |
| Constructor Detail |
|---|
public AbstractParentNode()
protected AbstractParentNode(AbstractParentNode<N> orig)
orig - The node to copy.| Method Detail |
|---|
public int numChildren()
ParentNode
numChildren in interface ParentNode<N extends Node>public N getChild(int index)
ParentNode
getChild in interface ParentNode<N extends Node>index - The index of the child to get.
public int getChildIndex(N child)
ParentNode
getChildIndex in interface ParentNode<N extends Node>child - The child to find the index of.
public List<N> getChildren()
ParentNode
getChildren in interface ParentNode<N extends Node>public void addChild(N child)
ParentNode
addChild in interface ParentNode<N extends Node>child - The child to add.
public void addChild(int index,
N child)
ParentNode
addChild in interface ParentNode<N extends Node>index - The index to add the child at.child - The child to add.public void removeChild(int index)
ParentNode
removeChild in interface ParentNode<N extends Node>index - The index of the child to remove.public void removeChild(N child)
ParentNode
removeChild in interface ParentNode<N extends Node>child - The child to remove.
public void replaceChild(int index,
N newChild)
ParentNode
replaceChild in interface ParentNode<N extends Node>index - The index of the child to replace.newChild - The new child.
public void replaceChild(N currChild,
N newChild)
ParentNode
replaceChild in interface ParentNode<N extends Node>currChild - The current child to be replaced.newChild - The new child.public void clearChildren()
ParentNode
clearChildren in interface ParentNode<N extends Node>public void addChildren(List<? extends N> children)
ParentNode
addChildren in interface ParentNode<N extends Node>children - The children to add.
public void addChildren(int index,
List<? extends N> children)
ParentNode
addChildren in interface ParentNode<N extends Node>index - The index to add the children at.children - The children to add.public void appendSourceStringForChildren(StringBuilder sb)
ParentNode
appendSourceStringForChildren in interface ParentNode<N extends Node>sb - The StringBuilder to which to append the children's source strings.
public void appendTreeStringForChildren(StringBuilder sb,
int indent)
ParentNode
appendTreeStringForChildren in interface ParentNode<N extends Node>sb - The StringBuilder to which to append the children's tree strings.indent - The current indentation level of this parent node.public String toTreeString(int indent)
Node
toTreeString in interface NodetoTreeString in class AbstractNodeindent - The indentation for each line of the tree string (usually pass 0).
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||