|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrabbit.html.HtmlBlock
public class 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(char[] page,
int length,
Charset cs,
byte[] decodeRest)
Create a HtmlBLock from the given byte array. |
|
| Method Summary | |
|---|---|
void |
addToken(Token t)
Add a Token to this block. |
List<ByteBuffer> |
getBlocks()
|
byte[] |
getRestBlock()
Get the rest as a byte[] |
List<Token> |
getTokens()
Get a List of the Tokens. |
boolean |
hasMoreTokens()
Does this block have more tokens? |
boolean |
hasRests()
Check if this block has any rest data, that is bytes that will not be used. |
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. |
void |
setRest(int reststart)
Set the rest of the page to start at given position. |
String |
toString()
Get a String representation of this block. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HtmlBlock(char[] page,
int length,
Charset cs,
byte[] decodeRest)
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 boolean hasRests()
public byte[] getRestBlock()
public void addToken(Token t)
t - the Token to add.public boolean hasMoreTokens()
public Token nextToken()
public List<Token> 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 String toString()
toString in class Objectpublic List<ByteBuffer> getBlocks()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||