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 of Ψ-readable, a type of objects that can be treated as a source of characters.
-
-
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 a character (Ψ-integer) from this object and returns it.PsyStringpsyReadLine()Read a line (Ψ-string) from this object and returns it.PsyStringpsyReadString(PsyInteger oCount)Read a Ψ-stringfrom this object and returns it.PsyBooleanpsyReady()Returns a Ψ-booleanindicating 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 PsyException
- Throws:
PsyException
-
psyRead
default PsyInteger psyRead() throws PsyException
Read a character (Ψ-integer) from this object and returns it. ReturnsPsyInteger.MINUS_ONEwhen end of input has been reached.- Returns:
- a Ψ-
integerrepresenting the character read from this object. - Throws:
PsyException- when error occurs.
-
psyReadString
PsyString psyReadString(PsyInteger oCount) throws PsyException
Read a Ψ-stringfrom this object and returns it.- Parameters:
oCount- a Ψ-integerrepresenting the length of the string.- Returns:
- a string read.
- Throws:
PsyException- when error occurs.
-
psyReadLine
PsyString psyReadLine() throws PsyException
Read a line (Ψ-string) from this object and returns it.- Returns:
- a line read,
- Throws:
PsyException- when error occurs.
-
psySkip
PsyInteger psySkip(PsyInteger oCount) throws PsyException
Skips characters. This method will block until some characters are available, an I/O error occurs, or end of input is reached.- Parameters:
oCount- a Ψ-integerrepresenting the number of characters to be skipped.- Returns:
- a Ψ-
integerrepresenting the number of characters actually skipped. - Throws:
PsyException- when an error occurs.
-
psyReady
PsyBoolean psyReady() throws PsyIOErrorException
Returns a Ψ-booleanindicating 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.
-
-