- All Known Implementing Classes:
PsyFileReader,PsyInput,PsyReader,PsyStringReader
The representation of
readable, an object that can be treated as a source of characters
to read from.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContextActionContext action of thereadoperator.static final ContextActionContext action of theskipoperator.Fields inherited from interface coneforest.psylla.core.PsyObject
PSY_CLONE, PSY_EQ, PSY_HASHCODE, PSY_INSTANCEOF, PSY_NE, PSY_TONAME, PSY_TOSTRING, PSY_TYPE -
Method Summary
Modifier and TypeMethodDescriptiondefault Optional<PsyInteger>psyRead()Read anintegercharacter from this object and returns it.Read a line (string) from this object and returns it.psyReadString(PsyInteger oCount) Read astringfrom this object and returns it.psyReady()Returns abooleanobject indicating whether this object is ready to be read.psySkip(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 Details
-
PSY_SKIP
Context action of theskipoperator. -
PSY_READ
Context action of thereadoperator.
-
-
Method Details
-
read
- Throws:
PsyIOErrorException
-
psyRead
Read anintegercharacter from this object and returns it. ReturnsPsyInteger.MINUS_ONEwhen end of input has been reached. TODO- Returns:
- an
integerrepresenting the character read from this object. - Throws:
PsyIOErrorException- when I/O error occurs.
-
psyReadString
PsyString psyReadString(PsyInteger oCount) throws PsyIOErrorException, PsyLimitCheckException, PsyRangeCheckException, PsyUnsupportedException Read astringfrom this object and returns it.- Parameters:
oCount- anintegerrepresenting the length of the string.- Returns:
- a string read.
- Throws:
PsyIOErrorException- when I/O error occurs.PsyLimitCheckExceptionPsyRangeCheckExceptionPsyUnsupportedException
-
psyReadLine
Read a line (string) from this object and returns it.- Returns:
- a line read.
- Throws:
PsyIOErrorException- when I/O error occurs.PsyUnsupportedException
-
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- anintegerrepresenting the number of characters to be skipped.- Returns:
- an
integerrepresenting the number of characters actually skipped. - Throws:
PsyIOErrorException- when I/O error occurs.PsyRangeCheckException
-
psyReady
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.
-