|
||||||||||
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. |
Constructor Summary | |
---|---|
TokenBuilder()
Empty constructor. |
|
TokenBuilder(byte[] str)
Constructor, specifying an initial array. |
|
TokenBuilder(int i)
Constructor, specifying an initial array size. |
|
TokenBuilder(String str)
Constructor, specifying an initial string. |
Method Summary | |
---|---|
TokenBuilder |
add(byte b)
Adds a single character to the token. |
TokenBuilder |
add(byte[] b)
Adds a byte array to the token. |
void |
add(byte[] b,
int s,
int e)
Adds a partial byte array to the token. |
TokenBuilder |
add(char ch)
Adds a single character to the token. |
TokenBuilder |
add(int i)
Adds an integer to the token. |
TokenBuilder |
add(Object str,
Object... ext)
Replaces all % characters in the input string by the specified extension objects, which can be byte arrays or any other object. |
TokenBuilder |
add(String s)
Adds a string to the token. |
TokenBuilder |
addUTF(int c)
Adds the specified UTF8 character. |
void |
chop()
Chops leading and trailing whitespaces. |
byte[] |
finish()
Returns the token as byte array. |
TokenBuilder |
high()
Adds a highlight flag. |
TokenBuilder |
hl()
Adds a half new line. |
TokenBuilder |
nl()
Adds a new line. |
TokenBuilder |
norm()
Adds a norm flag. |
void |
reset()
Resets the token buffer. |
int |
size()
Returns the number of entries. |
String |
toString()
|
boolean |
wsp()
Returns true if the token only contains whitespaces. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public boolean ent
Constructor Detail |
---|
public TokenBuilder()
public TokenBuilder(int i)
i
- sizepublic TokenBuilder(String str)
str
- initial stringpublic TokenBuilder(byte[] str)
str
- initial stringMethod Detail |
---|
public int size()
public void reset()
public TokenBuilder high()
public TokenBuilder norm()
public TokenBuilder nl()
public TokenBuilder hl()
public TokenBuilder add(char ch)
ch
- the character to be added
public TokenBuilder add(byte b)
b
- the character to be added
public TokenBuilder addUTF(int c)
c
- the character to be added
public TokenBuilder add(int i)
i
- the integer to be added
public TokenBuilder add(byte[] b)
b
- the character array to be added
public void add(byte[] b, int s, int e)
b
- the character array to be addeds
- start positione
- end positionpublic TokenBuilder add(String s)
s
- the string to be added
public TokenBuilder add(Object str, Object... ext)
str
- query informationext
- text text extensions
public void chop()
public boolean wsp()
public byte[] finish()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |