Package coneforest.psylla.core
Interface PsyReadable
-
- All Superinterfaces:
PsyConvertableToName,PsyConvertableToString,PsyObject,PsyReady
- All Known Implementing Classes:
PsyFileReader,PsyInput,PsyReader,PsyStringReader
public interface PsyReadable extends PsyReady
A representation ofreadable, an object that can be treated as a source of characters to read from.
-
-
Field Summary
Fields Modifier and Type Field Description static PsyOperator[]OPERATORS
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default PsyIntegerpsyRead()Read anintegercharacter from this object and returns it.PsyStringpsyReadLine()Read a line (string) from this object and returns it.PsyStringpsyReadString(PsyInteger oCount)Read astringfrom this object and returns it.PsyBooleanpsyReady()Returns abooleanobject indicating whether this object is ready to be read.PsyIntegerpsySkip(PsyInteger oCount)Skips characters.intread()-
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyClone, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, toSyntaxString, typeName
-
-
-
-
Field Detail
-
OPERATORS
static final PsyOperator[] OPERATORS
-
-
Method Detail
-
read
int read() throws PsyErrorException
- Throws:
PsyErrorException
-
psyRead
default PsyInteger psyRead() throws PsyErrorException
Read anintegercharacter from this object and returns it. ReturnsPsyInteger.MINUS_ONEwhen end of input has been reached.- Returns:
- an
integerrepresenting the character read from this object. - Throws:
PsyErrorException- when error occurs.
-
psyReadString
PsyString psyReadString(PsyInteger oCount) throws PsyErrorException
Read astringfrom this object and returns it.- Parameters:
oCount- anintegerrepresenting the length of the string.- Returns:
- a string read.
- Throws:
PsyErrorException- when error occurs.
-
psyReadLine
PsyString psyReadLine() throws PsyErrorException
Read a line (string) from this object and returns it.- Returns:
- a line read,
- Throws:
PsyErrorException- when error occurs.
-
psySkip
PsyInteger psySkip(PsyInteger oCount) throws PsyErrorException
Skips characters. This method will block until some characters are available, an I/O error occurs, or end of input is reached.- Parameters:
oCount- anintegerrepresenting the number of characters to be skipped.- Returns:
- an
integerrepresenting the number of characters actually skipped. - Throws:
PsyErrorException- when an error occurs.
-
psyReady
PsyBoolean psyReady() throws PsyIOErrorException
Returns abooleanobject indicating whether this object is ready to be read.- Specified by:
psyReadyin interfacePsyReady- Returns:
trueif this object is ready to be read, andfalseotherwise.- Throws:
PsyIOErrorException- when I/O error occurs.
-
-