public class CharSequenceSource extends java.lang.Object implements Source, java.io.Serializable
Constructor and Description |
---|
CharSequenceSource(java.lang.CharSequence source)
Constructs the CharSequenceSource.
|
Modifier and Type | Method and Description |
---|---|
char |
charAt(int arg0) |
void |
close()
Closes the source.
|
void |
deepClose()
Does a deep close of all sources and subsources associated with this
source.
|
Source |
fromActualPosition()
Creates a sub source starting from the actual position.
|
int |
getEnd() |
int |
getPos() |
int |
getPosition()
Get the actual read position of the source.
|
java.lang.CharSequence |
getSource() |
int |
getStart() |
boolean |
isEOF()
Checks if the end of the Source is reached.
|
int |
length() |
char |
next()
Returns the character at the given position and increases the position.
|
void |
seek(int position)
Seek to the given position
|
void |
setEnd(int end) |
void |
setPos(int pos) |
void |
setSource(java.lang.CharSequence source) |
void |
setStart(int start) |
java.lang.CharSequence |
subSequence(int start,
int end) |
Source |
subSource(int start,
int end)
Creates a sub source of this source.
|
java.lang.String |
toString() |
public CharSequenceSource(java.lang.CharSequence source)
source
- public Source subSource(int start, int end)
Source
subSource
in interface Source
start
- the start positionend
- the end positionSource.subSource(int, int)
public java.lang.CharSequence subSequence(int start, int end)
subSequence
in interface java.lang.CharSequence
CharSequence.subSequence(int, int)
public Source fromActualPosition()
Source
fromActualPosition
in interface Source
Source.fromActualPosition()
public int getPosition()
Source
getPosition
in interface Source
Source.getPosition()
public void seek(int position) throws java.io.IOException
Source
seek
in interface Source
java.io.IOException
Source.seek(int)
public char next() throws java.io.IOException
Source
next
in interface Source
java.io.IOException
Source.next()
public int length()
length
in interface java.lang.CharSequence
CharSequence.length()
public char charAt(int arg0)
charAt
in interface java.lang.CharSequence
CharSequence.charAt(int)
public java.lang.String toString()
toString
in interface java.lang.CharSequence
toString
in class java.lang.Object
Object.toString()
public boolean isEOF()
Source
isEOF
in interface Source
true
if the end of the source is reachedSource.isEOF()
public void close() throws java.io.IOException
Source
close
in interface Source
java.io.IOException
Source.close()
public void deepClose() throws java.io.IOException
Source
deepClose
in interface Source
java.io.IOException
Source.deepClose()
public int getEnd()
public void setEnd(int end)
end
- The end to set.public int getPos()
public void setPos(int pos)
pos
- The pos to set.public java.lang.CharSequence getSource()
public void setSource(java.lang.CharSequence source)
source
- The source to set.public int getStart()
public void setStart(int start)
start
- The start to set.Copyright © 2021. All Rights Reserved.