com.caucho.util
Class StringCharCursor

java.lang.Object
  extended by com.caucho.util.CharCursor
      extended by com.caucho.util.StringCharCursor
All Implemented Interfaces:
java.lang.Cloneable, java.text.CharacterIterator

public class StringCharCursor
extends CharCursor


Field Summary
 
Fields inherited from interface java.text.CharacterIterator
DONE
 
Constructor Summary
StringCharCursor(java.lang.CharSequence string)
           
StringCharCursor(java.lang.CharSequence string, int offset)
           
 
Method Summary
 java.lang.Object clone()
           
 char current()
           
 int getBeginIndex()
           
 int getEndIndex()
           
 int getIndex()
          returns the current location of the cursor
 void init(java.lang.CharSequence string)
           
 char next()
          reads a character from the cursor
 char previous()
          reads a character from the cursor
 char setIndex(int pos)
          sets the cursor to the position
 char skip(int n)
          Skips the next n characters
 
Methods inherited from class com.caucho.util.CharCursor
first, last, prev, read, regionMatches, regionMatchesIgnoreCase, subseq, subseq
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringCharCursor

public StringCharCursor(java.lang.CharSequence string)

StringCharCursor

public StringCharCursor(java.lang.CharSequence string,
                        int offset)
Method Detail

getIndex

public int getIndex()
returns the current location of the cursor

Specified by:
getIndex in interface java.text.CharacterIterator
Specified by:
getIndex in class CharCursor

getBeginIndex

public int getBeginIndex()
Specified by:
getBeginIndex in interface java.text.CharacterIterator
Specified by:
getBeginIndex in class CharCursor

getEndIndex

public int getEndIndex()
Specified by:
getEndIndex in interface java.text.CharacterIterator
Specified by:
getEndIndex in class CharCursor

setIndex

public char setIndex(int pos)
sets the cursor to the position

Specified by:
setIndex in interface java.text.CharacterIterator
Specified by:
setIndex in class CharCursor

next

public char next()
reads a character from the cursor

Specified by:
next in interface java.text.CharacterIterator
Specified by:
next in class CharCursor
Returns:
-1 on EOF

previous

public char previous()
reads a character from the cursor

Specified by:
previous in interface java.text.CharacterIterator
Specified by:
previous in class CharCursor
Returns:
-1 on EOF

current

public char current()
Specified by:
current in interface java.text.CharacterIterator
Specified by:
current in class CharCursor

skip

public char skip(int n)
Skips the next n characters

Overrides:
skip in class CharCursor

init

public void init(java.lang.CharSequence string)

clone

public java.lang.Object clone()
Specified by:
clone in interface java.text.CharacterIterator
Specified by:
clone in class CharCursor