Package coneforest.psylla.core
Class PsyInput
- java.lang.Object
-
- coneforest.psylla.core.PsyInput
-
- All Implemented Interfaces:
PsyCloseable
,PsyConvertableToName
,PsyConvertableToString
,PsyObject
,PsyReadable
,PsyResetable
public class PsyInput extends Object implements PsyCloseable, PsyReadable, PsyResetable
-
-
Constructor Summary
Constructors Constructor Description PsyInput(InputStream input)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStream
getInput()
void
psyClose()
Close this object.PsyString
psyReadLine()
Read a line (Ψ-string
) from this object and returns it.PsyString
psyReadString(PsyInteger oCount)
Read a Ψ-string
from this object and returns it.PsyBoolean
psyReady()
Returns a Ψ-boolean
indicating whether this object is ready to be read.void
psyReset()
Reset this object.PsyBoolean
psySkip(PsyInteger oCount)
Skips characters.int
read()
void
setInput(InputStream input)
-
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
-
-
-
-
Constructor Detail
-
PsyInput
public PsyInput(InputStream input)
-
-
Method Detail
-
setInput
public void setInput(InputStream input)
-
getInput
public InputStream getInput()
-
read
public int read() throws PsyException
- Specified by:
read
in interfacePsyReadable
- Throws:
PsyException
-
psyReadString
public PsyString psyReadString(PsyInteger oCount) throws PsyException
Description copied from interface:PsyReadable
Read a Ψ-string
from this object and returns it.- Specified by:
psyReadString
in interfacePsyReadable
- Parameters:
oCount
- a Ψ-integer
representing the length of the string.- Returns:
- a string read.
- Throws:
PsyException
- when error occurs.
-
psyReadLine
public PsyString psyReadLine() throws PsyException
Description copied from interface:PsyReadable
Read a line (Ψ-string
) from this object and returns it.- Specified by:
psyReadLine
in interfacePsyReadable
- Returns:
- a line read,
- Throws:
PsyException
- when error occurs.
-
psyClose
public void psyClose() throws PsyException
Description copied from interface:PsyCloseable
Close this object.- Specified by:
psyClose
in interfacePsyCloseable
- Throws:
PsyException
- when error occured during closing.
-
psyReady
public PsyBoolean psyReady() throws PsyException
Description copied from interface:PsyReadable
Returns a Ψ-boolean
indicating whether this object is ready to be read.- Specified by:
psyReady
in interfacePsyReadable
- Returns:
true
if this object is ready to be read, andfalse
otherwise.- Throws:
PsyException
- when I/O error occurs.
-
psySkip
public PsyBoolean psySkip(PsyInteger oCount) throws PsyException
Description copied from interface:PsyReadable
Skips characters. This method will block until some characters are available, an I/O error occurs, or end of input is reached.- Specified by:
psySkip
in interfacePsyReadable
- Parameters:
oCount
- a Ψ-integer
representing the number of characters to be skipped.- Returns:
- a Ψ-
boolean
indicating whether all the characters were skipped successfully - Throws:
PsyException
- when an error occurs.
-
psyReset
public void psyReset() throws PsyException
Description copied from interface:PsyResetable
Reset this object.- Specified by:
psyReset
in interfacePsyResetable
- Throws:
PsyException
- when error occured during reset.
-
-