public abstract class TreeElement extends ElementBase implements ASTNode, java.lang.Cloneable
Iconable.IconFlags, Iconable.LastComputedIcon
Modifier and Type | Field and Description |
---|---|
static TreeElement[] |
EMPTY_ARRAY |
FLAGS_LOCKED, ICON_PLACEHOLDER
ICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITY
Constructor and Description |
---|
TreeElement(IElementType type) |
Modifier and Type | Method and Description |
---|---|
abstract void |
acceptTree(TreeElementVisitor visitor) |
void |
clearCaches() |
java.lang.Object |
clone()
Creates and returns a deep copy of the AST tree part starting at this node.
|
ASTNode |
copyElement()
Creates a copy of the entire AST tree containing this node and returns a counterpart
of this node in the resulting tree.
|
boolean |
equals(java.lang.Object obj) |
abstract LeafElement |
findLeafElementAt(int offset)
Finds a leaf child node at the specified offset from the start of the text range of this node.
|
abstract int |
getCachedLength() |
IElementType |
getElementType()
Returns the type of this node.
|
abstract TreeElement |
getFirstChildNode()
Returns the first child of this node in the tree.
|
abstract TreeElement |
getLastChildNode()
Returns the last child of this node in the tree.
|
PsiManagerEx |
getManager() |
int |
getStartOffset()
Returns the starting offset of the node text in the document.
|
int |
getStartOffsetInParent()
Returns the starting offset of the node text relative to
ASTNode.getTreeParent() . |
int |
getTextOffset() |
TextRange |
getTextRange()
Returns the text range (a combination of starting offset in the document and length) for this node.
|
TreeElement |
getTreeNext()
Returns the next sibling of this node in the tree.
|
CompositeElement |
getTreeParent()
Returns the parent of this node in the tree.
|
TreeElement |
getTreePrev()
Returns the previous sibling of this node in the tree.
|
abstract int |
hc() |
protected void |
invalidate() |
protected void |
onInvalidated() |
void |
rawInsertAfterMe(TreeElement firstNew) |
void |
rawInsertBeforeMe(TreeElement firstNew) |
void |
rawRemove() |
void |
rawRemoveUpTo(TreeElement end) |
void |
rawRemoveUpToLast() |
void |
rawReplaceWithList(TreeElement firstNew) |
boolean |
textMatches(java.lang.CharSequence seq) |
protected abstract int |
textMatches(java.lang.CharSequence buffer,
int start) |
boolean |
textMatches(java.lang.CharSequence buffer,
int startOffset,
int endOffset) |
boolean |
textMatches(PsiElement element) |
abstract char [] |
textToCharArray() |
java.lang.String |
toString() |
buildRowIcon, computeBaseIcon, createLayeredIcon, getAdjustedBaseIcon, getBaseIcon, getElementIcon, getIcon, iconWithVisibilityIfNeeded, isNativeFileType, isVisibilitySupported, overlayIcons, registerIconLayer, transformFlags
changeUserMap, clearUserData, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMap
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addChild, addChild, addChildren, addLeaf, findChildByType, findChildByType, findChildByType, findChildByType, getChars, getChildren, getCopyableUserData, getPsi, getPsi, getText, getTextLength, putCopyableUserData, removeChild, removeRange, replaceAllChildrenToChildrenOf, replaceChild, textContains
getUserData, putUserData
public static final TreeElement[] EMPTY_ARRAY
public TreeElement(IElementType type)
public java.lang.Object clone()
ASTNode
clone
in interface ASTNode
clone
in class UserDataHolderBase
public ASTNode copyElement()
ASTNode
copyElement
in interface ASTNode
public PsiManagerEx getManager()
public abstract LeafElement findLeafElementAt(int offset)
ASTNode
findLeafElementAt
in interface ASTNode
offset
- the relative offset for which the child node is requested.public abstract char [] textToCharArray()
public abstract TreeElement getFirstChildNode()
ASTNode
getFirstChildNode
in interface ASTNode
public abstract TreeElement getLastChildNode()
ASTNode
getLastChildNode
in interface ASTNode
public abstract int getCachedLength()
public TextRange getTextRange()
ASTNode
getTextRange
in interface ASTNode
public int getStartOffset()
ASTNode
getStartOffset
in interface ASTNode
public final int getStartOffsetInParent()
ASTNode
ASTNode.getTreeParent()
.getStartOffsetInParent
in interface ASTNode
public int getTextOffset()
public boolean textMatches(java.lang.CharSequence buffer, int startOffset, int endOffset)
protected abstract int textMatches(java.lang.CharSequence buffer, int start)
public boolean textMatches(java.lang.CharSequence seq)
public boolean textMatches(PsiElement element)
public java.lang.String toString()
toString
in class java.lang.Object
public final CompositeElement getTreeParent()
ASTNode
getTreeParent
in interface ASTNode
public final TreeElement getTreePrev()
ASTNode
getTreePrev
in interface ASTNode
public final TreeElement getTreeNext()
ASTNode
getTreeNext
in interface ASTNode
public void clearCaches()
public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public abstract int hc()
public abstract void acceptTree(TreeElementVisitor visitor)
protected void onInvalidated()
public void rawInsertBeforeMe(TreeElement firstNew)
public void rawInsertAfterMe(TreeElement firstNew)
public void rawRemove()
public void rawReplaceWithList(TreeElement firstNew)
protected void invalidate()
public void rawRemoveUpToLast()
public void rawRemoveUpTo(TreeElement end)
public IElementType getElementType()
ASTNode
getElementType
in interface ASTNode