Package org.eclipse.xtext.nodemodel.impl
Class LeafNode
- java.lang.Object
-
- org.eclipse.xtext.nodemodel.impl.AbstractNode
-
- org.eclipse.xtext.nodemodel.impl.LeafNode
-
- All Implemented Interfaces:
java.lang.Iterable<INode>
,BidiIterable<INode>
,BidiTreeIterable<INode>
,ILeafNode
,INode
- Direct Known Subclasses:
HiddenLeafNode
,LeafNodeWithSyntaxError
public class LeafNode extends AbstractNode implements ILeafNode
- Noextend:
- This class is not intended to be subclassed by clients.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.xtext.nodemodel.impl.AbstractNode
AbstractNode.NodeType
-
-
Constructor Summary
Constructors Constructor Description LeafNode()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
basicSetTotalLength(int length)
protected void
basicSetTotalOffset(int offset)
java.lang.Iterable<ILeafNode>
getLeafNodes()
Returns an iterable for all contained leaf nodes.int
getLength()
Returns the length of this node excluding hidden tokens.protected AbstractNode.NodeType
getNodeId()
int
getOffset()
Returns the offset of this node excluding hidden tokens.int
getTotalLength()
Returns the length of this node including hidden tokens.int
getTotalOffset()
Returns the offset of this node including hidden tokens.boolean
isHidden()
Returnstrue
if the node was produced by a hidden token.protected void
readData(java.io.DataInputStream in, DeserializationConversionContext context)
protected void
write(java.io.DataOutputStream out, SerializationConversionContext scc)
-
Methods inherited from class org.eclipse.xtext.nodemodel.impl.AbstractNode
basicGetGrammarElement, basicGetLineOfOffset, basicGetNextSibling, basicGetParent, basicGetPreviousSibling, basicGetSemanticElement, basicHasNextSibling, basicHasPreviousSibling, basicHasSiblings, basicIterator, basicSetGrammarElement, basicSetNextSibling, basicSetParent, basicSetPreviousSibling, getAsTreeIterable, getEndLine, getEndOffset, getGrammarElement, getNextSibling, getParent, getPreviousSibling, getRootNode, getSemanticElement, getStartLine, getSyntaxErrorMessage, getText, getTextRegion, getTextRegionWithLineInformation, getTextRegionWithLineInformation, getTotalEndLine, getTotalEndOffset, getTotalStartLine, getTotalTextRegion, getTotalTextRegionWithLineInformation, hasDirectSemanticElement, hasNextSibling, hasPreviousSibling, hasSiblings, iterator, reverse
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.xtext.nodemodel.INode
getAsTreeIterable, getEndLine, getEndOffset, getGrammarElement, getNextSibling, getParent, getPreviousSibling, getRootNode, getSemanticElement, getStartLine, getSyntaxErrorMessage, getText, getTextRegion, getTextRegionWithLineInformation, getTotalEndLine, getTotalEndOffset, getTotalStartLine, getTotalTextRegion, getTotalTextRegionWithLineInformation, hasDirectSemanticElement, hasNextSibling, hasPreviousSibling, hasSiblings
-
-
-
-
Method Detail
-
isHidden
public boolean isHidden()
Description copied from interface:ILeafNode
Returnstrue
if the node was produced by a hidden token.
-
getTotalOffset
public int getTotalOffset()
Description copied from interface:INode
Returns the offset of this node including hidden tokens.- Specified by:
getTotalOffset
in interfaceINode
- Returns:
- the offset of this node including hidden tokens.
-
getTotalLength
public int getTotalLength()
Description copied from interface:INode
Returns the length of this node including hidden tokens.- Specified by:
getTotalLength
in interfaceINode
- Returns:
- the length of this node including hidden tokens.
-
getOffset
public int getOffset()
Description copied from interface:INode
Returns the offset of this node excluding hidden tokens. If this node is a hidden leaf node or a composite node that does only contain hidden leaf nodes, the total offset is returned.- Specified by:
getOffset
in interfaceINode
- Overrides:
getOffset
in classAbstractNode
- Returns:
- the offset of this node excluding hidden tokens.
-
getLength
public int getLength()
Description copied from interface:INode
Returns the length of this node excluding hidden tokens. If this node is a hidden leaf node, the total length is returned.- Specified by:
getLength
in interfaceINode
- Overrides:
getLength
in classAbstractNode
- Returns:
- the length of this node excluding hidden tokens.
-
basicSetTotalOffset
protected void basicSetTotalOffset(int offset)
-
basicSetTotalLength
protected void basicSetTotalLength(int length)
-
getLeafNodes
public java.lang.Iterable<ILeafNode> getLeafNodes()
Description copied from interface:INode
Returns an iterable for all contained leaf nodes. Nevernull
.- Specified by:
getLeafNodes
in interfaceINode
- Overrides:
getLeafNodes
in classAbstractNode
- Returns:
- an iterable for all contained leaf nodes. Never
null
.
-
readData
protected void readData(java.io.DataInputStream in, DeserializationConversionContext context) throws java.io.IOException
- Overrides:
readData
in classAbstractNode
- Throws:
java.io.IOException
-
write
protected void write(java.io.DataOutputStream out, SerializationConversionContext scc) throws java.io.IOException
- Overrides:
write
in classAbstractNode
- Throws:
java.io.IOException
-
getNodeId
protected AbstractNode.NodeType getNodeId()
- Specified by:
getNodeId
in classAbstractNode
-
-