Package coneforest.psylla.core
Interface PsyReadable
- All Superinterfaces:
PsyConvertableToName
,PsyConvertableToString
,PsyObject
,PsyReady
- All Known Implementing Classes:
PsyFileReader
,PsyInput
,PsyReader
,PsyStringReader
A representation of
readable
, an object that can be treated as a
source of characters to read from.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault PsyInteger
psyRead()
Read aninteger
character from this object and returns it.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.psySkip
(PsyInteger oCount) Skips characters.int
read()
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyClone, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, toSyntaxString, typeName
-
Field Details
-
OPERATORS
-
-
Method Details
-
read
- Throws:
PsyErrorException
-
psyRead
Read aninteger
character from this object and returns it. ReturnsPsyInteger.MINUS_ONE
when end of input has been reached.- Returns:
- an
integer
representing the character read from this object. - Throws:
PsyErrorException
- when error occurs.
-
psyReadString
Read astring
from this object and returns it.- Parameters:
oCount
- aninteger
representing the length of the string.- Returns:
- a string read.
- Throws:
PsyErrorException
- when error occurs.
-
psyReadLine
Read a line (string
) from this object and returns it.- Returns:
- a line read,
- Throws:
PsyErrorException
- when error occurs.
-
psySkip
Skips characters. This method will block until some characters are available, an I/O error occurs, or end of input is reached.- Parameters:
oCount
- aninteger
representing the number of characters to be skipped.- Returns:
- an
integer
representing the number of characters actually skipped. - Throws:
PsyErrorException
- when an error occurs.
-
psyReady
Returns aboolean
object indicating whether this object is ready to be read.- Specified by:
psyReady
in interfacePsyReady
- Returns:
true
if this object is ready to be read, andfalse
otherwise.- Throws:
PsyIOErrorException
- when I/O error occurs.
-