|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.armedbear.lisp.Lisp
org.armedbear.lisp.LispObject
org.armedbear.lisp.Stream
public class Stream
The stream class A base class for all Lisp built-in streams.
Nested Class Summary | |
---|---|
static class |
Stream.EolStyle
|
Field Summary | |
---|---|
protected int |
charPos
The number of characters on the current line of output Used to determine whether additional line feeds are required when calling FRESH-LINE |
protected LispObject |
elementType
|
protected java.lang.String |
encoding
|
protected char |
eolChar
|
protected Stream.EolStyle |
eolStyle
|
protected LispObject |
externalFormat
|
protected boolean |
isBinaryStream
|
protected boolean |
isCharacterStream
|
protected boolean |
isInputStream
|
protected boolean |
isOutputStream
|
protected static Symbol |
keywordDefault
|
protected char |
lastChar
|
protected int |
lineNumber
|
protected int |
offset
|
static Stream.EolStyle |
platformEolStyle
|
protected java.io.PushbackReader |
reader
|
Constructor Summary | |
---|---|
protected |
Stream()
|
|
Stream(java.io.InputStream inputStream,
LispObject elementType)
|
|
Stream(java.io.InputStream inputStream,
LispObject elementType,
boolean interactive)
|
|
Stream(java.io.InputStream inputStream,
LispObject elementType,
LispObject format)
|
|
Stream(java.io.OutputStream outputStream,
LispObject elementType)
|
|
Stream(java.io.OutputStream outputStream,
LispObject elementType,
boolean interactive)
|
|
Stream(java.io.OutputStream outputStream,
LispObject elementType,
LispObject format)
|
Method Summary | |
---|---|
protected boolean |
_charReady()
Returns a boolean indicating input readily available |
void |
_clearInput()
Reads all input from the underlying stream, until _charReady() indicates no more input to be available |
void |
_close()
Closes the stream and underlying streams |
void |
_finishOutput()
Flushes any buffered output in the (underlying) stream |
protected long |
_getFilePosition()
Returns a (non-negative) file position integer or a negative value if the position cannot be determined. |
int |
_readByte()
Reads an 8-bit byte off the underlying stream |
protected int |
_readChar()
Reads a character off an underlying stream |
protected boolean |
_setFilePosition(LispObject arg)
Sets the file position based on a position designator passed in arg |
protected void |
_unreadChar(int n)
Puts a character back into the (underlying) stream |
void |
_writeByte(int n)
Writes an 8-bit byte off the underlying stream |
void |
_writeChar(char c)
Writes a character into the underlying stream, updating charPos while doing so |
void |
_writeChars(char[] chars,
int start,
int end)
Writes a series of characters in the underlying stream, updating charPos while doing so |
void |
_writeLine(java.lang.String s)
Writes a string to the underlying stream, appending a new line and updating charPos while doing so |
void |
_writeString(java.lang.String s)
Writes a string to the underlying stream, updating charPos while doing so |
LispObject |
classOf()
|
LispObject |
clearInput()
|
LispObject |
close(LispObject abort)
|
LispObject |
faslRead(boolean eofError,
LispObject eofValue,
boolean recursive,
LispThread thread)
|
LispObject |
faslReadArray(int rank)
|
LispObject |
faslReadComplex()
|
LispObject |
faslReadPathname()
|
LispObject |
faslReadRadix(int radix)
|
LispObject |
faslReadStructure()
|
LispObject |
fileLength()
|
LispObject |
fileStringLength(LispObject arg)
|
LispObject |
finishOutput()
|
LispObject |
freshLine()
|
int |
getCharPos()
|
LispObject |
getElementType()
|
java.lang.String |
getEncoding()
|
LispObject |
getExternalFormat()
|
LispObject |
getFilePosition()
|
int |
getLineNumber()
|
int |
getOffset()
|
protected void |
initAsBinaryInputStream(java.io.InputStream in)
|
protected void |
initAsBinaryOutputStream(java.io.OutputStream out)
|
protected void |
initAsCharacterInputStream(java.io.Reader reader)
|
protected void |
initAsCharacterOutputStream(java.io.Writer writer)
|
static java.lang.String |
invert(java.lang.String s,
java.util.BitSet flags)
|
boolean |
isBinaryInputStream()
|
boolean |
isBinaryOutputStream()
|
boolean |
isCharacterInputStream()
|
boolean |
isCharacterOutputStream()
|
boolean |
isInputStream()
|
boolean |
isInteractive()
|
boolean |
isOpen()
|
boolean |
isOutputStream()
|
LispObject |
listen()
|
void |
prin1(LispObject obj)
|
void |
print(char c)
|
void |
printStackTrace(java.lang.Throwable t)
|
LispObject |
read(boolean eofError,
LispObject eofValue,
boolean recursive,
LispThread thread)
|
LispObject |
readArray(int rank)
|
LispObject |
readByte(boolean eofError,
LispObject eofValue)
|
LispObject |
readChar()
|
LispObject |
readChar(boolean eofError,
LispObject eofValue)
|
LispObject |
readCharacterLiteral(Readtable rt,
LispThread thread)
|
LispObject |
readCharNoHang(boolean eofError,
LispObject eofValue)
|
LispObject |
readComplex()
|
LispObject |
readDelimitedList(char delimiter)
|
LispObject |
readDispatchChar(char dispChar,
boolean useFaslReadtable)
|
LispObject |
readLine(boolean eofError,
LispObject eofValue)
|
LispObject |
readList(boolean requireProperList,
boolean useFaslReadtable)
|
LispObject |
readPathname()
|
LispObject |
readPreservingWhitespace(boolean eofError,
LispObject eofValue,
boolean recursive,
LispThread thread)
|
LispObject |
readRadix(int radix)
|
LispObject |
readStructure()
|
LispObject |
readSymbol()
|
LispObject |
readSymbol(Readtable rt)
|
void |
setCharPos(int n)
|
void |
setExternalFormat(LispObject format)
|
LispObject |
setFilePosition(LispObject arg)
|
void |
setInteractive(boolean b)
|
void |
setOpen(boolean b)
|
protected void |
setWriter(java.io.Writer writer)
|
void |
skipBalancedComment()
|
protected LispObject |
streamNotBinaryOutputStream()
|
protected LispObject |
streamNotCharacterInputStream()
|
protected LispObject |
streamNotCharacterOutputStream()
|
protected LispObject |
streamNotInputStream()
|
protected LispObject |
streamNotOutputStream()
|
LispObject |
terpri()
|
java.lang.String |
toString()
|
LispObject |
typeOf()
|
LispObject |
typep(LispObject typeSpecifier)
|
LispObject |
unreadChar(LispCharacter c)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected LispObject elementType
protected boolean isInputStream
protected boolean isOutputStream
protected boolean isCharacterStream
protected boolean isBinaryStream
protected java.io.PushbackReader reader
protected int offset
protected int lineNumber
protected int charPos
protected static final Symbol keywordDefault
public static final Stream.EolStyle platformEolStyle
protected Stream.EolStyle eolStyle
protected char eolChar
protected LispObject externalFormat
protected java.lang.String encoding
protected char lastChar
Constructor Detail |
---|
protected Stream()
public Stream(java.io.InputStream inputStream, LispObject elementType)
public Stream(java.io.InputStream inputStream, LispObject elementType, LispObject format)
public Stream(java.io.InputStream inputStream, LispObject elementType, boolean interactive)
public Stream(java.io.OutputStream outputStream, LispObject elementType)
public Stream(java.io.OutputStream outputStream, LispObject elementType, LispObject format)
public Stream(java.io.OutputStream outputStream, LispObject elementType, boolean interactive)
Method Detail |
---|
protected void initAsCharacterInputStream(java.io.Reader reader)
protected void initAsBinaryInputStream(java.io.InputStream in)
protected void initAsCharacterOutputStream(java.io.Writer writer)
protected void initAsBinaryOutputStream(java.io.OutputStream out)
public boolean isInputStream() throws ConditionThrowable
ConditionThrowable
public boolean isOutputStream() throws ConditionThrowable
ConditionThrowable
public boolean isCharacterInputStream() throws ConditionThrowable
ConditionThrowable
public boolean isBinaryInputStream() throws ConditionThrowable
ConditionThrowable
public boolean isCharacterOutputStream() throws ConditionThrowable
ConditionThrowable
public boolean isBinaryOutputStream() throws ConditionThrowable
ConditionThrowable
public boolean isInteractive()
public void setInteractive(boolean b)
public LispObject getExternalFormat()
public java.lang.String getEncoding()
public void setExternalFormat(LispObject format)
public boolean isOpen()
public void setOpen(boolean b)
public LispObject typeOf()
typeOf
in class LispObject
public LispObject classOf()
classOf
in class LispObject
public LispObject typep(LispObject typeSpecifier) throws ConditionThrowable
typep
in class LispObject
ConditionThrowable
public LispObject getElementType() throws ConditionThrowable
ConditionThrowable
public int getOffset()
public final int getLineNumber()
protected void setWriter(java.io.Writer writer)
public int getCharPos()
public void setCharPos(int n)
public LispObject read(boolean eofError, LispObject eofValue, boolean recursive, LispThread thread) throws ConditionThrowable
ConditionThrowable
public LispObject readPreservingWhitespace(boolean eofError, LispObject eofValue, boolean recursive, LispThread thread) throws ConditionThrowable
ConditionThrowable
public LispObject faslRead(boolean eofError, LispObject eofValue, boolean recursive, LispThread thread) throws ConditionThrowable
ConditionThrowable
public LispObject readPathname() throws ConditionThrowable
ConditionThrowable
public LispObject faslReadPathname() throws ConditionThrowable
ConditionThrowable
public LispObject readSymbol() throws ConditionThrowable
ConditionThrowable
public LispObject readSymbol(Readtable rt) throws ConditionThrowable
ConditionThrowable
public LispObject readStructure() throws ConditionThrowable
ConditionThrowable
public LispObject faslReadStructure() throws ConditionThrowable
ConditionThrowable
public LispObject readList(boolean requireProperList, boolean useFaslReadtable) throws ConditionThrowable
ConditionThrowable
public LispObject readDispatchChar(char dispChar, boolean useFaslReadtable) throws ConditionThrowable
ConditionThrowable
public LispObject readCharacterLiteral(Readtable rt, LispThread thread) throws ConditionThrowable
ConditionThrowable
public void skipBalancedComment() throws ConditionThrowable
ConditionThrowable
public LispObject readArray(int rank) throws ConditionThrowable
ConditionThrowable
public LispObject faslReadArray(int rank) throws ConditionThrowable
ConditionThrowable
public LispObject readComplex() throws ConditionThrowable
ConditionThrowable
public LispObject faslReadComplex() throws ConditionThrowable
ConditionThrowable
public static final java.lang.String invert(java.lang.String s, java.util.BitSet flags)
public LispObject readRadix(int radix) throws ConditionThrowable
ConditionThrowable
public LispObject faslReadRadix(int radix) throws ConditionThrowable
ConditionThrowable
public LispObject readDelimitedList(char delimiter) throws ConditionThrowable
ConditionThrowable
public LispObject readLine(boolean eofError, LispObject eofValue) throws ConditionThrowable
ConditionThrowable
public LispObject readChar() throws ConditionThrowable
ConditionThrowable
public LispObject readChar(boolean eofError, LispObject eofValue) throws ConditionThrowable
ConditionThrowable
public LispObject readCharNoHang(boolean eofError, LispObject eofValue) throws ConditionThrowable
ConditionThrowable
public LispObject unreadChar(LispCharacter c) throws ConditionThrowable
ConditionThrowable
public LispObject finishOutput() throws ConditionThrowable
ConditionThrowable
public LispObject clearInput() throws ConditionThrowable
ConditionThrowable
public LispObject getFilePosition() throws ConditionThrowable
ConditionThrowable
public LispObject setFilePosition(LispObject arg) throws ConditionThrowable
ConditionThrowable
public LispObject close(LispObject abort) throws ConditionThrowable
ConditionThrowable
public java.lang.String toString()
toString
in class java.lang.Object
public LispObject readByte(boolean eofError, LispObject eofValue) throws ConditionThrowable
ConditionThrowable
public LispObject terpri() throws ConditionThrowable
ConditionThrowable
public LispObject freshLine() throws ConditionThrowable
ConditionThrowable
public void print(char c) throws ConditionThrowable
ConditionThrowable
public void prin1(LispObject obj) throws ConditionThrowable
ConditionThrowable
public LispObject listen() throws ConditionThrowable
ConditionThrowable
public LispObject fileLength() throws ConditionThrowable
ConditionThrowable
public LispObject fileStringLength(LispObject arg) throws ConditionThrowable
ConditionThrowable
protected int _readChar() throws ConditionThrowable
ConditionThrowable
protected void _unreadChar(int n) throws ConditionThrowable
n
-
ConditionThrowable
protected boolean _charReady() throws ConditionThrowable
ConditionThrowable
public void _writeChar(char c) throws ConditionThrowable
c
-
ConditionThrowable
public void _writeChars(char[] chars, int start, int end) throws ConditionThrowable
chars
- start
- end
-
ConditionThrowable
public void _writeString(java.lang.String s) throws ConditionThrowable
s
-
ConditionThrowable
public void _writeLine(java.lang.String s) throws ConditionThrowable
s
-
ConditionThrowable
public int _readByte() throws ConditionThrowable
ConditionThrowable
public void _writeByte(int n) throws ConditionThrowable
n
-
ConditionThrowable
public void _finishOutput() throws ConditionThrowable
ConditionThrowable
public void _clearInput() throws ConditionThrowable
ConditionThrowable
protected long _getFilePosition() throws ConditionThrowable
ConditionThrowable
protected boolean _setFilePosition(LispObject arg) throws ConditionThrowable
arg
- File position specifier as described in the CLHS
ConditionThrowable
public void _close() throws ConditionThrowable
ConditionThrowable
public void printStackTrace(java.lang.Throwable t) throws ConditionThrowable
ConditionThrowable
protected LispObject streamNotInputStream() throws ConditionThrowable
ConditionThrowable
protected LispObject streamNotCharacterInputStream() throws ConditionThrowable
ConditionThrowable
protected LispObject streamNotOutputStream() throws ConditionThrowable
ConditionThrowable
protected LispObject streamNotBinaryOutputStream() throws ConditionThrowable
ConditionThrowable
protected LispObject streamNotCharacterOutputStream() throws ConditionThrowable
ConditionThrowable
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |