|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectscone.util.tokenstream.TokenInputStream
scone.util.tokenstream.TokenInputStreamTokenizerImpl
public class TokenInputStreamTokenizerImpl
converts a Reader into a TokenInputStream. If no Tokenizer is specified, the standard HTML tokenizer is used. Any Tokenizer can be specified to process HTML, XML or any other doument type.
Constructor Summary | |
---|---|
TokenInputStreamTokenizerImpl(java.io.Reader reader)
creates a new TokenInputStreamTokenizer that parses a Reader into HTML tokens. |
|
TokenInputStreamTokenizerImpl(java.io.Reader reader,
java.lang.String tokenizer)
creates a new TokenInputStreamTokenizerImpl that parses a Reader into Tokens using the specified Tokenizer. |
Method Summary | |
---|---|
void |
close()
Close the input stream. |
java.util.Hashtable |
getMetaInfo()
returns the meta info associated with this TokenInputStream |
boolean |
isClosed()
Determines if the input stream is closed. |
void |
mark(int readAheadLimit)
Mark the stream for later resetting |
boolean |
markSupported()
Test whether mark() and reset() are supported. |
Token |
read()
Read a Token from the input stream. |
int |
read(Token[] buf)
Read Tokens from the input stream filling the specified Token array. |
int |
read(Token[] buf,
int offset,
int length)
Read multiple Tokens from the input stream. |
void |
reset()
Reset the stream to its previous mark |
Methods inherited from class scone.util.tokenstream.TokenInputStream |
---|
create, create |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TokenInputStreamTokenizerImpl(java.io.Reader reader)
reader
- the Readerpublic TokenInputStreamTokenizerImpl(java.io.Reader reader, java.lang.String tokenizer)
reader
- the Readertokenizer
- the complete class name of the TokenizerMethod Detail |
---|
public Token read() throws java.io.IOException
read
in class TokenInputStream
java.io.IOException
- If stream closed.
MarkPreservedException
- If read would invalidate preserved
markpublic int read(Token[] buf, int offset, int length) throws java.io.IOException
read
in class TokenInputStream
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 int read(Token[] buf) throws java.io.IOException
read
in class TokenInputStream
buf
- The Token buffer to populate.
java.io.IOException
- If stream closed.
MarkPreservedException
- If read would invalidate preserved
markpublic void close() throws java.io.IOException
close
in class TokenInputStream
java.io.IOException
public boolean isClosed()
isClosed
in class TokenInputStream
true
if stream closed; else false
.public boolean markSupported()
mark()
and reset()
are supported.
markSupported
in class TokenInputStream
true
if mark()
and
reset()
are supported, false
otherwise.public void mark(int readAheadLimit) throws java.io.IOException
mark
in class TokenInputStream
readlimit
- The number of Tokens read beyond which the mark
will become invalid.
java.io.IOException
public void reset() throws java.io.IOException
reset
in class TokenInputStream
java.io.IOException
- if the stream was not marked or the mark
has become invalid.public java.util.Hashtable getMetaInfo()
getMetaInfo
in class TokenInputStream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |