Package coneforest.psylla.core
Class PsyReader
java.lang.Object
coneforest.psylla.core.PsyReader
- All Implemented Interfaces:
PsyCloseable
,PsyConvertableToName
,PsyConvertableToString
,PsyEvaluable
,PsyObject
,PsyReadable
,PsyReady
,PsyResetable
- Direct Known Subclasses:
PsyFileReader
,PsyStringReader
public class PsyReader
extends Object
implements PsyCloseable, PsyEvaluable, PsyReadable, PsyResetable
-
Field Summary
FieldsFields inherited from interface coneforest.psylla.core.PsyCloseable
OPERATORS
Fields inherited from interface coneforest.psylla.core.PsyEvaluable
OPERATORS
Fields inherited from interface coneforest.psylla.core.PsyReadable
OPERATORS
Fields inherited from interface coneforest.psylla.core.PsyResetable
OPERATORS
-
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
-
-
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
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
-
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
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
-
psyReset
Description copied from interface:PsyResetable
Reset thisresetable
object.- Specified by:
psyReset
in interfacePsyResetable
- Throws:
PsyIOErrorException
-