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
Fields Modifier and Type Field Description static StringLINE_SEPARATOR-
Fields 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 Constructor Description PsyReader(InputStream is)PsyReader(Reader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidpsyClose()Closes this object.voidpsyEval()Evaluate this object in the current context.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.voidpsyReset()Reset this object.PsyIntegerpsySkip(PsyInteger oCount)Skips characters.intread()Readerreader()-
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 Detail
-
LINE_SEPARATOR
public static final String LINE_SEPARATOR
-
-
Constructor Detail
-
PsyReader
public PsyReader(Reader reader)
-
PsyReader
public PsyReader(InputStream is)
-
-
Method Detail
-
psyEval
public void psyEval() throws PsyExceptionDescription copied from interface:PsyEvaluableEvaluate this object in the current context.- Specified by:
psyEvalin interfacePsyEvaluable- Throws:
PsyException- when an error occurs durind evaluation of this object.
-
reader
public Reader reader()
-
read
public int read() throws PsyIOErrorException- Specified by:
readin interfacePsyReadable- Throws:
PsyIOErrorException
-
psyReadString
public PsyString psyReadString(PsyInteger oCount) throws PsyIOErrorException, PsyLimitCheckException, PsyRangeCheckException
Description copied from interface:PsyReadableRead a Ψ-stringfrom this object and returns it.- Specified by:
psyReadStringin interfacePsyReadable- Parameters:
oCount- a Ψ-integerrepresenting the length of the string.- Returns:
- a string read.
- Throws:
PsyIOErrorExceptionPsyLimitCheckExceptionPsyRangeCheckException
-
psyReadLine
public PsyString psyReadLine() throws PsyIOErrorException
Description copied from interface:PsyReadableRead a line (Ψ-string) from this object and returns it.- Specified by:
psyReadLinein interfacePsyReadable- Returns:
- a line read,
- Throws:
PsyIOErrorException
-
psySkip
public PsyInteger psySkip(PsyInteger oCount) throws PsyIOErrorException, PsyRangeCheckException
Description copied from interface:PsyReadableSkips characters. This method will block until some characters are available, an I/O error occurs, or end of input is reached.- Specified by:
psySkipin interfacePsyReadable- Parameters:
oCount- a Ψ-integerrepresenting the number of characters to be skipped.- Returns:
- a Ψ-
integerrepresenting the number of characters actually skipped. - Throws:
PsyIOErrorExceptionPsyRangeCheckException
-
psyReady
public PsyBoolean psyReady() throws PsyIOErrorException
Description copied from interface:PsyReadableReturns a Ψ-booleanindicating whether this object is ready to be read.- Specified by:
psyReadyin interfacePsyReadable- Specified by:
psyReadyin interfacePsyReady- Returns:
trueif this object is ready to be read, andfalseotherwise.- Throws:
PsyIOErrorException- when I/O error occurs.
-
psyClose
public void psyClose() throws PsyIOErrorExceptionDescription copied from interface:PsyCloseableCloses this object.- Specified by:
psyClosein interfacePsyCloseable- Throws:
PsyIOErrorException
-
psyReset
public void psyReset() throws PsyIOErrorExceptionDescription copied from interface:PsyResetableReset this object.- Specified by:
psyResetin interfacePsyResetable- Throws:
PsyIOErrorException
-
-