org.sonar.sslr.internal.text
Class PlainText

java.lang.Object
  extended by org.sonar.sslr.internal.text.AbstractText
      extended by 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
PlainText(char[] chars)
           
 
Method Summary
 char charAt(int index)
           
 TextLocation getLocation(int index)
           
 Text getText()
           
protected  int getTransformationDepth()
           
 int length()
           
 TextCharSequence sequence()
          Provides sequential access to characters.
 TextCharSequence subSequence(int from, int to)
           
 Text subText(int start, int end)
           
 void toCharArray(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, toString, wait, wait, wait
 
Methods inherited from interface org.sonar.sslr.text.TextCharSequence
toString
 

Constructor Detail

PlainText

public PlainText(char[] chars)
Method Detail

subText

public Text subText(int start,
                    int end)
Specified by:
subText in interface TextCharSequence
Parameters:
start - the start index, inclusive
end - the end index, exclusive

getTransformationDepth

protected int getTransformationDepth()
Specified by:
getTransformationDepth in class AbstractText

getText

public Text getText()
Specified by:
getText in interface TextCharSequence

length

public int length()
Specified by:
length in interface CharSequence
Specified by:
length in interface Text
Specified by:
length in interface TextCharSequence
Returns:
the number of characters in this text

toCharArray

public void toCharArray(int srcPos,
                        char[] dest,
                        int destPos,
                        int length)
Specified by:
toCharArray in class AbstractText

sequence

public TextCharSequence sequence()
Description copied from interface: Text
Provides sequential access to characters.

Specified by:
sequence in interface Text

charAt

public char charAt(int index)
Specified by:
charAt in interface CharSequence
Specified by:
charAt in interface TextCharSequence

subSequence

public TextCharSequence subSequence(int from,
                                    int to)
Specified by:
subSequence in interface CharSequence
Specified by:
subSequence in interface TextCharSequence
Parameters:
from - the start index, inclusive
to - the end index, exclusive

getLocation

public TextLocation getLocation(int index)
Specified by:
getLocation in interface TextCharSequence


Copyright © 2009-2014 SonarSource. All Rights Reserved.