Package org.sonar.sslr.internal.text
Class PlainText
- java.lang.Object
-
- org.sonar.sslr.internal.text.AbstractText
-
- org.sonar.sslr.internal.text.PlainText
-
- All Implemented Interfaces:
CharSequence,Text,TextCharSequence
- Direct Known Subclasses:
LocatedText
public class PlainText extends AbstractText implements TextCharSequence
-
-
Constructor Summary
Constructors Constructor Description PlainText(char[] chars)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description charcharAt(int index)TextLocationgetLocation(int index)TextgetText()protected intgetTransformationDepth()intlength()TextCharSequencesequence()Provides sequential access to characters.TextCharSequencesubSequence(int from, int to)TextsubText(int start, int end)voidtoCharArray(int srcPos, char[] dest, int destPos, int length)-
Methods inherited from class org.sonar.sslr.internal.text.AbstractText
toChars, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
Methods inherited from interface org.sonar.sslr.text.TextCharSequence
toString
-
-
-
-
Method Detail
-
subText
public Text subText(int start, int end)
- Specified by:
subTextin interfaceTextCharSequence- Parameters:
start- the start index, inclusiveend- the end index, exclusive
-
getTransformationDepth
protected int getTransformationDepth()
- Specified by:
getTransformationDepthin classAbstractText
-
getText
public Text getText()
- Specified by:
getTextin interfaceTextCharSequence
-
length
public int length()
- Specified by:
lengthin interfaceCharSequence- Specified by:
lengthin interfaceText- Specified by:
lengthin interfaceTextCharSequence- Returns:
- the number of characters in this text
-
toCharArray
public void toCharArray(int srcPos, char[] dest, int destPos, int length)- Specified by:
toCharArrayin classAbstractText
-
sequence
public TextCharSequence sequence()
Description copied from interface:TextProvides sequential access to characters.
-
charAt
public char charAt(int index)
- Specified by:
charAtin interfaceCharSequence- Specified by:
charAtin interfaceTextCharSequence
-
subSequence
public TextCharSequence subSequence(int from, int to)
- Specified by:
subSequencein interfaceCharSequence- Specified by:
subSequencein interfaceTextCharSequence- Parameters:
from- the start index, inclusiveto- the end index, exclusive
-
getLocation
public TextLocation getLocation(int index)
- Specified by:
getLocationin interfaceTextCharSequence
-
-