|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectscone.util.tokenstream.TokenInputStream
public abstract class TokenInputStream
an InputStream that works on Tokens.
TokenInputStreams are similar to MegInputStreams, but they operate
on Token objects instead of bytes. TokenInputStream and TokenOutputStream
are examples for the use of MegObject.
This class provides static methods that create TokenInputStreams that read
data from RequestEvents.
Constructor Summary | |
---|---|
TokenInputStream()
|
Method Summary | |
---|---|
abstract void |
close()
Close the input stream. |
static TokenInputStream |
create(RequestEvent e)
Returns a TokenInputStream that allows to acces the input data provided by the RequestEvent as Tokens. |
static TokenInputStream |
create(RequestEvent e,
java.lang.String tokenizer)
Returns a TokenInputStream that allows to acces the input data provided by the RequestEvent as Tokens. |
abstract java.util.Hashtable |
getMetaInfo()
returns the meta info associated with this TokenInputStream |
abstract boolean |
isClosed()
Determines if the input stream is closed. |
abstract void |
mark(int readAheadLimit)
Mark the stream for later resetting |
abstract boolean |
markSupported()
Test whether mark() and reset() are supported. |
abstract Token |
read()
Read a Token from the input stream. |
abstract int |
read(Token[] buf)
Read Tokens from the input stream filling the specified Token array. |
abstract int |
read(Token[] buf,
int offset,
int length)
Read multiple Tokens from the input stream. |
abstract void |
reset()
Reset the stream to its previous mark |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TokenInputStream()
Method Detail |
---|
public static TokenInputStream create(RequestEvent e, java.lang.String tokenizer) throws java.lang.Exception
e
- the RequestEventtokenizer
- the class name of the tokenizer
java.lang.Exception
public static TokenInputStream create(RequestEvent e) throws java.lang.Exception
e
- the RequestEvent
java.lang.Exception
public abstract Token read() throws java.io.IOException
java.io.IOException
- If stream closed.
MarkPreservedException
- If read would invalidate preserved
markpublic abstract int read(Token[] buf, int offset, int length) throws java.io.IOException
buf
- The Token buffer to populate.offset
- The offset in buf
to starting writing to.length
- The amount of Tokens to write.
java.io.IOException
- If stream closed.
MarkPreservedException
- If read would invalidate preserved
markpublic abstract int read(Token[] buf) throws java.io.IOException
buf
- The Token buffer to populate.
java.io.IOException
- If stream closed.
MarkPreservedException
- If read would invalidate preserved
markpublic abstract void close() throws java.io.IOException
java.io.IOException
public abstract boolean isClosed()
true
if stream closed; else false
.public abstract boolean markSupported()
mark()
and reset()
are supported.
true
if mark()
and
reset()
are supported, false
otherwise.public abstract void mark(int readAheadLimit) throws java.io.IOException
readlimit
- The number of Tokens read beyond which the mark
will become invalid.
java.io.IOException
public abstract void reset() throws java.io.IOException
java.io.IOException
- if the stream was not marked or the mark
has become invalid.public abstract java.util.Hashtable getMetaInfo()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |