org.freecompany.util.text
Class CharSequenceWrapper

java.lang.Object
  extended by org.freecompany.util.text.CharSequenceWrapper
All Implemented Interfaces:
java.lang.CharSequence, UnicodeSequence

public class CharSequenceWrapper
extends java.lang.Object
implements UnicodeSequence


Constructor Summary
CharSequenceWrapper(java.lang.CharSequence characters)
           
 
Method Summary
 char charAt(int index)
           
 int codePointAt(int index)
          Decodes the code point at the specified index in this sequence.
 int codePointCount()
          Returns a count of the total number of Unicode code points in this character sequence.
 int length()
           
 java.lang.CharSequence subSequence(int start, int end)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CharSequenceWrapper

public CharSequenceWrapper(java.lang.CharSequence characters)
Method Detail

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

subSequence

public java.lang.CharSequence subSequence(int start,
                                          int end)
Specified by:
subSequence in interface java.lang.CharSequence

codePointCount

public int codePointCount()
Description copied from interface: UnicodeSequence
Returns a count of the total number of Unicode code points in this character sequence.

Specified by:
codePointCount in interface UnicodeSequence
Returns:
the number of code points.

codePointAt

public int codePointAt(int index)
Description copied from interface: UnicodeSequence
Decodes the code point at the specified index in this sequence. This method throws an index of out bounds exception in the case of an invalid index. The valid range of arguments is zero to UnicodeSequence.codePointCount(). If this sequence is zero length this method will always fail.

Specified by:
codePointAt in interface UnicodeSequence
Parameters:
index - the index of the code point to decode and return.
Returns:
the code point at the selected index.

toString

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