|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.basex.util.TokenBuilder
public final class TokenBuilder
This class serves as an efficient constructor for byte arrays.
It bears some resemblance to Java's StringBuilder.
| Field Summary | |
|---|---|
boolean |
ent
Entity flag. |
int |
size
Current token size. |
| Constructor Summary | |
|---|---|
TokenBuilder()
Empty constructor. |
|
TokenBuilder(char ch)
Constructor, specifying an initial character. |
|
TokenBuilder(java.lang.String str)
Constructor, specifying an initial string. |
|
| Method Summary | |
|---|---|
void |
add(byte b)
Adds a single character to the token. |
void |
add(byte[] b)
Adds a character array to the token. |
void |
add(char ch)
Adds a single character to the token. |
void |
add(int i)
Adds an integer to the token. |
void |
add(java.lang.String s)
Adds a string to the token. |
void |
add(java.lang.String string,
java.lang.Object... ext)
Adds some query information. |
void |
addUTF(int c)
Adds the specified UTF8 character. |
byte[] |
finish()
Returns the token as a byte array. |
void |
insert(byte b)
Inserts a single character at the beginning of the token. |
void |
replace(byte b,
int pos)
Replaces a character at the specified position. |
void |
reset()
Resets the token buffer. |
java.lang.String |
toString()
|
void |
trim()
Chops trailing whitespaces. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public boolean ent
public int size
| Constructor Detail |
|---|
public TokenBuilder()
public TokenBuilder(char ch)
ch - first characterpublic TokenBuilder(java.lang.String str)
str - initial string| Method Detail |
|---|
public void add(byte b)
b - the character to be addedpublic void add(byte[] b)
b - the character array to be addedpublic void add(char ch)
ch - the character to be addedpublic void add(int i)
i - the integer to be addedpublic void add(java.lang.String s)
s - the string to be added
public void add(java.lang.String string,
java.lang.Object... ext)
string - query informationext - text text extensionspublic void addUTF(int c)
c - the character to be addedpublic byte[] finish()
public void insert(byte b)
b - the character to be added
public void replace(byte b,
int pos)
b - the character to be setpos - positionpublic void reset()
public java.lang.String toString()
toString in class java.lang.Objectpublic void trim()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||