| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectrabbit.html.HTMLBlock
This class is used to describe a piece of a HTML page. A block is composed of Tokens and a rest (unparseable data, unfinished tags etc).
| Constructor Summary | |
| HTMLBlock(byte[] page,
          int length)Create a HTMLBLock from the given byte array. | |
| Method Summary | |
|  void | addToken(Token t)Add a Token to this block. | 
|  java.lang.String | getRest()Get the rest of this block. | 
|  java.util.Vector | getTokens()Get a Vector of the Tokens. | 
|  boolean | hasMoreTokens()Does this block have more tokens? | 
|  void | insertRest(byte[] b)Copy the rest into the given byte array. | 
|  void | insertToken(Token t,
            int pos)Insert a token at given position. | 
|  Token | nextToken()Get the next Token. | 
|  void | removeToken(int pos)Remove a Token at the given position. | 
|  int | restSize()Get the number of bytes that the rest is. | 
|  void | send(java.io.OutputStream out)Send this block (but not the rest part) on the given stream. | 
|  void | sendRest(java.io.OutputStream out)Send the rest of the data on the given stream. | 
|  void | setRest(int reststart)Set the rest of the page to start at given position. | 
|  java.lang.String | toString()Get a String representation of this block. | 
| Methods inherited from class java.lang.Object | 
| equals, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Constructor Detail | 
public HTMLBlock(byte[] page,
                 int length)
page - the byte array that is the real page| Method Detail | 
public void setRest(int reststart)
reststart - the new index of the rest of the page.public java.lang.String getRest()
public int restSize()
public void insertRest(byte[] b)
b - the byte array to copy the rest into.public void addToken(Token t)
t - the Token to add.public boolean hasMoreTokens()
public Token nextToken()
public java.util.Vector getTokens()
public void insertToken(Token t,
                        int pos)
t - the Token to insert.pos - the position to insert the token at.public void removeToken(int pos)
pos - the position of the token to remove.public java.lang.String toString()
public void send(java.io.OutputStream out)
          throws java.io.IOException
java.io.IOException
public void sendRest(java.io.OutputStream out)
              throws java.io.IOException
out - the Stream to send the data on.
java.io.IOException - if writing the data fails.| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||