org.eclipse.xtend.core.richstring
Class TextLine

java.lang.Object
  extended by org.eclipse.xtend.core.richstring.TextLine
All Implemented Interfaces:
java.lang.CharSequence
Direct Known Subclasses:
TextLine.LeadingWSTextLinePart

public class TextLine
extends java.lang.Object
implements java.lang.CharSequence

Implementation CharSequence that is tailored to line-per-line processing of text and supports special handling of whitespace.

Author:
Sebastian Zarnekow - Initial contribution and API

Nested Class Summary
protected static class TextLine.LeadingWSTextLinePart
           
 
Constructor Summary
TextLine(java.lang.String completeText, int offset, int length, int delimiterLength)
           
 
Method Summary
 char charAt(int index)
           
 boolean containsOnlyWhitespace()
           
 boolean equals(java.lang.Object obj)
           
 java.lang.String getCompleteText()
           
 int getDelimiterLength()
           
 java.lang.CharSequence getLeadingWhiteSpace()
           
 int getRelativeOffset()
           
 int hashCode()
           
 boolean hasLeadingWhiteSpace()
           
 boolean hasTrailingLineBreak()
           
 int length()
           
 java.lang.CharSequence subSequence(int start, int end)
           
protected  void throwIndexOutOfBounds(int offset)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextLine

public TextLine(java.lang.String completeText,
                int offset,
                int length,
                int delimiterLength)
Method Detail

getCompleteText

public java.lang.String getCompleteText()

hasLeadingWhiteSpace

public boolean hasLeadingWhiteSpace()

containsOnlyWhitespace

public boolean containsOnlyWhitespace()

getLeadingWhiteSpace

public java.lang.CharSequence getLeadingWhiteSpace()

hasTrailingLineBreak

public boolean hasTrailingLineBreak()

getRelativeOffset

public int getRelativeOffset()

length

public int length()
Specified by:
length in interface java.lang.CharSequence

charAt

public char charAt(int index)
Specified by:
charAt in interface java.lang.CharSequence

getDelimiterLength

public int getDelimiterLength()

toString

public java.lang.String toString()
Specified by:
toString in interface java.lang.CharSequence
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

subSequence

public java.lang.CharSequence subSequence(int start,
                                          int end)
Specified by:
subSequence in interface java.lang.CharSequence
Throws:
java.lang.IndexOutOfBoundsException - if start or end are negative, if end is greater than length(), or if start is greater than end

throwIndexOutOfBounds

protected void throwIndexOutOfBounds(int offset)