org.apache.regexp
Class CharacterArrayCharacterIterator

java.lang.Object
  |
  +--org.apache.regexp.CharacterArrayCharacterIterator
All Implemented Interfaces:
CharacterIterator

public final class CharacterArrayCharacterIterator
extends java.lang.Object
implements CharacterIterator

Encapsulates char[] as CharacterIterator

Version:
CVS $Id: CharacterArrayCharacterIterator.java 518156 2007-03-14 14:31:26Z vgritsenko $
Author:
Ales Novak

Field Summary
private  int len
          used portion of the array
private  int off
          offset in the char array
private  char[] src
          encapsulated
 
Constructor Summary
CharacterArrayCharacterIterator(char[] src, int off, int len)
           
 
Method Summary
 char charAt(int pos)
           
 boolean isEnd(int pos)
           
 java.lang.String substring(int beginIndex)
           
 java.lang.String substring(int beginIndex, int endIndex)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

src

private final char[] src
encapsulated

off

private final int off
offset in the char array

len

private final int len
used portion of the array
Constructor Detail

CharacterArrayCharacterIterator

public CharacterArrayCharacterIterator(char[] src,
                                       int off,
                                       int len)
Parameters:
src - - encapsulated String
Method Detail

substring

public java.lang.String substring(int beginIndex,
                                  int endIndex)
Specified by:
substring in interface CharacterIterator
Returns:
a substring

substring

public java.lang.String substring(int beginIndex)
Specified by:
substring in interface CharacterIterator
Returns:
a substring

charAt

public char charAt(int pos)
Specified by:
charAt in interface CharacterIterator
Returns:
a character at the specified position.

isEnd

public boolean isEnd(int pos)
Specified by:
isEnd in interface CharacterIterator
Returns:
true iff if the specified index is after the end of the character stream


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.