Package org.apache.wicket.util.string
Class PrependingStringBuffer
- java.lang.Object
-
- org.apache.wicket.util.string.PrependingStringBuffer
-
public class PrependingStringBuffer extends Object
This is a prepending stringbuffer optimized for constantly prepending strings to the front of the buffer.- Author:
- jcompagner
-
-
Constructor Summary
Constructors Constructor Description PrependingStringBuffer()Default constructor, the internal initial buffer size will be 16PrependingStringBuffer(int size)Constructs this PrependingStringBuffer with the given buffer size.PrependingStringBuffer(String start)Constructs and direct inserts the given string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)inthashCode()intlength()Returns the size of this PrependingStringBufferPrependingStringBufferprepend(char ch)Prepends one char to this PrependingStringBufferPrependingStringBufferprepend(String str)Prepends the string to this PrependingStringBufferStringtoString()
-
-
-
Constructor Detail
-
PrependingStringBuffer
public PrependingStringBuffer()
Default constructor, the internal initial buffer size will be 16
-
PrependingStringBuffer
public PrependingStringBuffer(int size)
Constructs this PrependingStringBuffer with the given buffer size.- Parameters:
size- The initial size of the buffer.
-
PrependingStringBuffer
public PrependingStringBuffer(String start)
Constructs and direct inserts the given string. The buffer size will be string.length+16- Parameters:
start- The string that is directly inserted.
-
-
Method Detail
-
prepend
public PrependingStringBuffer prepend(char ch)
Prepends one char to this PrependingStringBuffer- Parameters:
ch- The char that will be prepended- Returns:
- this
-
prepend
public PrependingStringBuffer prepend(String str)
Prepends the string to this PrependingStringBuffer- Parameters:
str- The string that will be prepended- Returns:
- this
-
length
public int length()
Returns the size of this PrependingStringBuffer- Returns:
- The size
-
toString
public String toString()
- Overrides:
toStringin classObject- See Also:
Object.toString()
-
-