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_CLOSE
Fields inherited from interface coneforest.psylla.core.PsyEvaluable
PSY_EVAL
Fields inherited from interface coneforest.psylla.core.PsyObject
PSY_CLONE, PSY_EQ, PSY_HASHCODE, PSY_INSTANCEOF, PSY_NE, PSY_TONAME, PSY_TOSTRING, PSY_TYPE
Fields inherited from interface coneforest.psylla.core.PsyReadable
PSY_READ, PSY_SKIP
Fields inherited from interface coneforest.psylla.core.PsyResetable
PSY_RESET
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
psyClose()
Closes this object.void
psyEval()
Evaluate this object in the current context.Read a line (string
) from this object and returns it.psyReadString
(PsyInteger oCount) Read astring
from this object and returns it.psyReady()
Returns aboolean
object indicating whether this object is ready to be read.void
psyReset()
Reset thisresetable
object.psySkip
(PsyInteger oCount) Skips characters.int
read()
reader()
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyClone, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, toSyntaxString, typeName
Methods inherited from interface coneforest.psylla.core.PsyReadable
psyRead
-
Field Details
-
LINE_SEPARATOR
Line separator string.
-
-
Constructor Details
-
PsyReader
-
PsyReader
-
-
Method Details
-
psyEval
Description copied from interface:PsyEvaluable
Evaluate this object in the current context.- Specified by:
psyEval
in interfacePsyEvaluable
- Throws:
PsyErrorException
- when an error occurs durind evaluation of this object.
-
reader
-
read
- Specified by:
read
in interfacePsyReadable
- Throws:
PsyIOErrorException
-
psyReadString
public PsyString psyReadString(PsyInteger oCount) throws PsyIOErrorException, PsyLimitCheckException, PsyRangeCheckException Description copied from interface:PsyReadable
Read astring
from this object and returns it.- Specified by:
psyReadString
in interfacePsyReadable
- Parameters:
oCount
- aninteger
representing the length of the string.- Returns:
- a string read.
- Throws:
PsyIOErrorException
- when I/O error occurs.PsyLimitCheckException
PsyRangeCheckException
-
psyReadLine
Description copied from interface:PsyReadable
Read a line (string
) from this object and returns it.- Specified by:
psyReadLine
in interfacePsyReadable
- Returns:
- a line read.
- Throws:
PsyIOErrorException
- when I/O error occurs.
-
psySkip
Description copied from interface:PsyReadable
Skips characters. This method will block until some characters are available, an I/O error occurs, or end of input is reached.- Specified by:
psySkip
in interfacePsyReadable
- Parameters:
oCount
- aninteger
representing the number of characters to be skipped.- Returns:
- an
integer
representing the number of characters actually skipped. - Throws:
PsyIOErrorException
- when I/O error occurs.PsyRangeCheckException
-
psyReady
Description copied from interface:PsyReadable
Returns aboolean
object indicating whether this object is ready to be read.- Specified by:
psyReady
in interfacePsyReadable
- Specified by:
psyReady
in interfacePsyReady
- Returns:
true
if this object is ready to be read, andfalse
otherwise.- Throws:
PsyIOErrorException
- when I/O error occurs.
-
psyClose
Description copied from interface:PsyCloseable
Closes this object.- Specified by:
psyClose
in interfacePsyCloseable
- Throws:
PsyIOErrorException
- when I/O error occured during closing.
-
psyReset
Description copied from interface:PsyResetable
Reset thisresetable
object.- Specified by:
psyReset
in interfacePsyResetable
- Throws:
PsyIOErrorException
-