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 voidbasicSetTotalLength(int length)protected voidbasicSetTotalOffset(int offset)java.lang.Iterable<ILeafNode>getLeafNodes()Returns an iterable for all contained leaf nodes.intgetLength()Returns the length of this node excluding hidden tokens.protected AbstractNode.NodeTypegetNodeId()intgetOffset()Returns the offset of this node excluding hidden tokens.intgetTotalLength()Returns the length of this node including hidden tokens.intgetTotalOffset()Returns the offset of this node including hidden tokens.booleanisHidden()Returnstrueif the node was produced by a hidden token.protected voidreadData(java.io.DataInputStream in, DeserializationConversionContext context)protected voidwrite(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:ILeafNodeReturnstrueif the node was produced by a hidden token.
-
getTotalOffset
public int getTotalOffset()
Description copied from interface:INodeReturns the offset of this node including hidden tokens.- Specified by:
getTotalOffsetin interfaceINode- Returns:
- the offset of this node including hidden tokens.
-
getTotalLength
public int getTotalLength()
Description copied from interface:INodeReturns the length of this node including hidden tokens.- Specified by:
getTotalLengthin interfaceINode- Returns:
- the length of this node including hidden tokens.
-
getOffset
public int getOffset()
Description copied from interface:INodeReturns 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:
getOffsetin interfaceINode- Overrides:
getOffsetin classAbstractNode- Returns:
- the offset of this node excluding hidden tokens.
-
getLength
public int getLength()
Description copied from interface:INodeReturns the length of this node excluding hidden tokens. If this node is a hidden leaf node, the total length is returned.- Specified by:
getLengthin interfaceINode- Overrides:
getLengthin 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:INodeReturns an iterable for all contained leaf nodes. Nevernull.- Specified by:
getLeafNodesin interfaceINode- Overrides:
getLeafNodesin 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:
readDatain classAbstractNode- Throws:
java.io.IOException
-
write
protected void write(java.io.DataOutputStream out, SerializationConversionContext scc) throws java.io.IOException- Overrides:
writein classAbstractNode- Throws:
java.io.IOException
-
getNodeId
protected AbstractNode.NodeType getNodeId()
- Specified by:
getNodeIdin classAbstractNode
-
-