java.lang.Object
coneforest.psylla.core.PsyReader
- All Implemented Interfaces:
PsyCloseable,PsyEvaluable,PsyObject,PsyReadable,PsyReady,PsyResetable
- Direct Known Subclasses:
PsyFileReader,PsyStringReader
@Type("reader")
public class PsyReader
extends Object
implements PsyCloseable, PsyEvaluable, PsyReadable, PsyResetable
The representation of
reader.-
Field Summary
FieldsFields inherited from interface coneforest.psylla.core.PsyCloseable
PSY_CLOSEFields inherited from interface coneforest.psylla.core.PsyEvaluable
PSY_EVALFields inherited from interface coneforest.psylla.core.PsyObject
PSY_CLONE, PSY_EQ, PSY_HASHCODE, PSY_INSTANCEOF, PSY_NE, PSY_TONAME, PSY_TOSTRING, PSY_TYPEFields inherited from interface coneforest.psylla.core.PsyReadable
PSY_READ, PSY_SKIPFields inherited from interface coneforest.psylla.core.PsyResetable
PSY_RESET -
Constructor Summary
ConstructorsConstructorDescriptionPsyReader(InputStream is) Constructs a newreaderobject from the input stream.Constructs a newreaderobject from the reader. -
Method Summary
Modifier and TypeMethodDescriptionvoidpsyClose()Closes this object.voidpsyEval(PsyContext oContext) Evaluate this object in the current context.Read a line (string) from this object and returns it.psyReadString(PsyInteger oCount) Read astringfrom this object and returns it.psyReady()Returns abooleanobject indicating whether this object is ready to be read.voidpsyReset()Reset thisresetableobject.psySkip(PsyInteger oCount) Skips characters.intread()reader()Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyClone, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, toSyntaxString, typeNameMethods inherited from interface coneforest.psylla.core.PsyReadable
psyRead
-
Field Details
-
LINE_SEPARATOR
Line separator string.
-
-
Constructor Details
-
PsyReader
Constructs a newreaderobject from the reader.- Parameters:
reader- the reader.
-
PsyReader
Constructs a newreaderobject from the input stream.- Parameters:
is- the input stream.
-
-
Method Details
-
psyEval
Description copied from interface:PsyEvaluableEvaluate this object in the current context.- Specified by:
psyEvalin interfacePsyEvaluable- Throws:
PsyErrorException- when an error occurs durind evaluation of this object.
-
reader
-
read
- Specified by:
readin interfacePsyReadable- Throws:
PsyIOErrorException
-
psyReadString
public PsyString psyReadString(PsyInteger oCount) throws PsyIOErrorException, PsyLimitCheckException, PsyRangeCheckException Description copied from interface:PsyReadableRead astringfrom this object and returns it.- Specified by:
psyReadStringin interfacePsyReadable- Parameters:
oCount- anintegerrepresenting the length of the string.- Returns:
- a string read.
- Throws:
PsyIOErrorException- when I/O error occurs.PsyLimitCheckExceptionPsyRangeCheckException
-
psyReadLine
Description copied from interface:PsyReadableRead a line (string) from this object and returns it.- Specified by:
psyReadLinein interfacePsyReadable- Returns:
- a line read.
- Throws:
PsyIOErrorException- when I/O error occurs.
-
psySkip
Description copied from interface:PsyReadableSkips characters. This method will block until some characters are available, an I/O error occurs, or end of input is reached.- Specified by:
psySkipin interfacePsyReadable- Parameters:
oCount- anintegerrepresenting the number of characters to be skipped.- Returns:
- an
integerrepresenting the number of characters actually skipped. - Throws:
PsyIOErrorException- when I/O error occurs.PsyRangeCheckException
-
psyReady
Description copied from interface:PsyReadableReturns abooleanobject indicating whether this object is ready to be read.- Specified by:
psyReadyin interfacePsyReadable- Specified by:
psyReadyin interfacePsyReady- Returns:
trueif this object is ready to be read, andfalseotherwise.- Throws:
PsyIOErrorException- when I/O error occurs.
-
psyClose
Description copied from interface:PsyCloseableCloses this object.- Specified by:
psyClosein interfacePsyCloseable- Throws:
PsyIOErrorException- when I/O error occured during closing.
-
psyReset
Description copied from interface:PsyResetableReset thisresetableobject.- Specified by:
psyResetin interfacePsyResetable- Throws:
PsyIOErrorException
-