|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rabbit.html.Token
This class is used to describe a small part of a html page. A small part is the text between the tags, a tag, a comment or a script.
Field Summary | |
static int |
COMMENT
This token is a comment. |
static int |
EMPTY
This token is empty |
static int |
SCRIPT
This token is a script |
static int |
TAG
This token is a tag. |
static int |
TEXT
This token is text. |
Constructor Summary | |
Token(byte[] page,
int type,
int startindex,
int len)
Create a new Token with given arguments. |
|
Token(java.lang.String text)
Create a new Token of type TEXT with given text. |
|
Token(java.lang.String text,
int type,
int startindex)
Create a new Token with given arguments. |
|
Token(Tag tag)
Create a new Token of type Tag with given Tag. |
|
Token(Tag tag,
boolean changed)
Create a new Token of type Tag with given Tag. |
|
Token(Tag tag,
int startindex)
Create a new Token with given arguments and of type TAG. |
Method Summary | |
void |
empty()
Empty this token, That is set its type to EMPTY and set the text and tag to null. |
boolean |
getChanged()
Has this Token changed since it was created? |
int |
getStartIndex()
Get the start index of this Token. |
Tag |
getTag()
Get the tag of this token. |
java.lang.String |
getText()
Get the text of this token. |
int |
getType()
Get the type of this token. |
void |
setChanged(boolean changed)
Set the change value of this Token. |
void |
setStartIndex(int startindex)
Set the start index of this Token. |
void |
setTag(Tag tag)
Set the tag of this token, also set the type to TAG. |
void |
setText(java.lang.String text)
Set the text of this Token, also sets the type to TEXT. |
java.lang.String |
toString()
Get the String representation of this object. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int EMPTY
public static final int TEXT
public static final int TAG
public static final int COMMENT
public static final int SCRIPT
Constructor Detail |
public Token(java.lang.String text)
text
- the String of this Token.public Token(Tag tag)
tag
- the Tag of this Token.public Token(Tag tag, boolean changed)
tag
- the Tag of this Token.public Token(java.lang.String text, int type, int startindex)
text
- the text of this Token.type
- the type of this token.startindex
- the start index of this token.public Token(byte[] page, int type, int startindex, int len)
page
- the page this token is from.type
- the type of this token.startindex
- the start index of this token.len
- the length of this token.public Token(Tag tag, int startindex)
tag
- the Tag of this Token.startindex
- the start index of this token.Method Detail |
public Tag getTag()
public void setTag(Tag tag)
tag
- the Tag to hold.public java.lang.String getText()
public void setText(java.lang.String text)
text
- the text of this token.public int getType()
public boolean getChanged()
public void setChanged(boolean changed)
changed
- the new change value of this Token.public int getStartIndex()
public void setStartIndex(int startindex)
startindex
- the new startindex.public void empty()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |