| Constructor and Description |
|---|
CharSource(char[] chars) |
CharSource(char[] chars,
int position,
int limit) |
| Modifier and Type | Method and Description |
|---|---|
void |
get(char[] src)
Copies remaining char data of this
CharSource into the src char
array. |
void |
get(char[] src,
int srcPos)
Copies remaining char data of this
CharSource into the src char
starting from the srcPos. |
void |
get(char[] src,
int srcPos,
int length)
Copies chars data of this
CharSource into the src char starting
from the srcPos. |
int |
getCapacity() |
char[] |
getChars() |
boolean |
hasNext()
Returns true if there is another byte which can be read from this
ByteSource |
int |
limit() |
char |
next()
Reads next char from data source
|
int |
position() |
void |
reload(char[] chars)
Reloads this
CharSource with given chars. |
void |
reload(char[] chars,
int position)
Reloads this
CharSource with given chars. |
void |
reload(char[] chars,
int position,
int limit)
Reloads this
CharSource with given chars |
int |
remaining()
Number of chars remainig in this
CharSource. |
void |
reset(boolean full)
Flushes out data, repositions counters and markers held by this object
|
void |
setPosition(int position)
Sets position index to the given value
|
public CharSource(char[] chars)
public CharSource(char[] chars,
int position,
int limit)
public char[] getChars()
public int position()
public int limit()
public int getCapacity()
public final boolean hasNext()
ByteSourcepublic char next()
public void get(char[] src)
CharSource into the src char
array. If the length of src array is smaller than the remaining content,
the method will throw ArrayIndexOutOfBoundsExceptionsrc - srcpublic void get(char[] src,
int srcPos)
CharSource into the src char
starting from the srcPos. If the length of src array is smaller than the
remaining content, the method will throw
ArrayIndexOutOfBoundsExceptionsrc - srcsrcPos - srcPospublic void get(char[] src,
int srcPos,
int length)
CharSource into the src char starting
from the srcPos. If the length of src array is smaller than the remaining
content, the method will throw ArrayIndexOutOfBoundsExceptionsrc - srcsrcPos - srcPoslength - lengthpublic void reset(boolean full)
Resetablepublic void reload(char[] chars)
CharSource with given chars. The position of the
char source will be set to zero and limit will be set to the length of
the char array.chars - chars array (data)public void reload(char[] chars,
int position)
CharSource with given chars. The position of the
char source will be set to the position supplied and limit will be set to
the length of the char array.chars - chars array (data)position - position from which reading will startpublic void reload(char[] chars,
int position,
int limit)
CharSource with given charschars - chars array (data)position - position from which reading will startlimit - boundary index. The reading cursor will always be behind the
boundarypublic void setPosition(int position)
position - positionpublic int remaining()
CharSource. The number is
calculated based on the value of limit and
position variables; although at any point underlying
array has all the elements.Copyright © 2019. All rights reserved.