|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectariba.util.core.FastStringBuffer
ariba.util.core.FormatBuffer
public class FormatBuffer
A version of a FastStringBuffer that is able to append some basic java types directly without having to use intermediate strings. This class is used to try to improve performance by avoiding memory allocations in string formatting.
Constructor Summary | |
---|---|
FormatBuffer()
Make a FormatBuffer. |
|
FormatBuffer(int size)
Make a FormatBuffer. |
Method Summary | |
---|---|
void |
append(char c)
Append a character to the FormatBuffer. |
void |
append(double d)
Append a double to the FormatBuffer. |
void |
append(FormatBuffer that)
Append a one FormatBuffer to another FormatBuffer. |
void |
append(int i)
Append an integer to the FormatBuffer. |
void |
append(int i,
int radix)
Append an integer in a radix format to the FormatBuffer. |
void |
append(long l)
Append a long to the FormatBuffer. |
boolean |
isEmpty()
Determine if the FormatBuffer is empty. |
void |
print(java.io.OutputStream out)
Write the contents of this FormatBuffer to an OutputStream. |
void |
print(java.io.PrintWriter out)
Write the contents of this FormatBuffer to a Writer . |
void |
print(java.io.Writer out)
Write the contents of this FormatBuffer to a Writer. |
int |
size()
Return the number of bytes used in buffer. |
Methods inherited from class ariba.util.core.FastStringBuffer |
---|
append, append, append, append, appendCharRange, appendStringRange, charArray, charAt, getBuffer, getDoublesCapacityWhenGrowing, indexOf, indexOf, indexOf, indexOf, insert, insert, length, moveChars, removeCharAt, replace, replace, replace, setCharAt, setDoublesCapacityWhenGrowing, setStringValue, startsWith, startsWith, substring, tabOrSpaceAt, toString, truncateToLength |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FormatBuffer()
public FormatBuffer(int size)
size
- the number of characters the FormatBuffer can hold
without growing.Method Detail |
---|
public void append(char c)
append
in class FastStringBuffer
c
- the character to appendpublic void append(int i)
i
- the integer to appendpublic void append(int i, int radix)
i
- the integer to appendradix
- the radix to use for encoding the integer
i. The radix must be between Character.MIN_RADIX
and Character.MAX_RADIXCharacter.MAX_RADIX
,
Character.MIN_RADIX
public void append(long l)
l
- the long to appendpublic void append(double d)
d
- the double to appendpublic void append(FormatBuffer that)
that
- a FormatBuffer to append to this FormatBufferpublic int size()
public boolean isEmpty()
public void print(java.io.PrintWriter out)
Writer
.
out
- the PrintWriter to write the output into.public void print(java.io.Writer out) throws java.io.IOException
out
- the PrintWriter to write the output into.
java.io.IOException
public void print(java.io.OutputStream out) throws java.io.IOException
out
- the OutputStream to write the output into.
java.io.IOException
- if an error occurs in writing to
out
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |