EDU.bmrb.starlibj
Class HomemadeStringBuffer

java.lang.Object
  |
  +--EDU.bmrb.starlibj.HomemadeStringBuffer

public class HomemadeStringBuffer
extends java.lang.Object

I made this as a stopgap measure to behave much like the standard type: java.lang.StringBuffer. I needed a drop-in replacement for StringBuffer.because the one that came with the Blackdown JDK for Linux is broken. It eats ten times as much memory as needed when you append to it slowly in a loop while doing other things (it is hard to recreate).


Constructor Summary
HomemadeStringBuffer()
           
HomemadeStringBuffer(java.lang.String copyMe)
           
 
Method Summary
 void append(char appendMe)
          Append a char to this string buffer.
 void append(char[] appendMe)
          Append a char array to this string buffer.
 void append(java.lang.String appendMe)
          Append a string to this string buffer.
 int capacity()
          Get the total size the array buffer is using (This is how big the array can grow before the next time it will need to automatically relocate itself into a bigger array).
 char charAt(int idx)
          Functions identically to the StringBuffer function of the same name.
 char[] getBuf()
          Get the character array buffer that holds this string
 void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
          Functions identically to the StringBuffer function of the same name.
 int length()
          Get the useful length of the array buffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HomemadeStringBuffer

public HomemadeStringBuffer()

HomemadeStringBuffer

public HomemadeStringBuffer(java.lang.String copyMe)
Method Detail

getBuf

public char[] getBuf()
Get the character array buffer that holds this string

length

public int length()
Get the useful length of the array buffer

capacity

public int capacity()
Get the total size the array buffer is using (This is how big the array can grow before the next time it will need to automatically relocate itself into a bigger array).

charAt

public char charAt(int idx)
Functions identically to the StringBuffer function of the same name.

getChars

public void getChars(int srcBegin,
                     int srcEnd,
                     char[] dst,
                     int dstBegin)
Functions identically to the StringBuffer function of the same name.

append

public void append(java.lang.String appendMe)
Append a string to this string buffer.

append

public void append(char[] appendMe)
Append a char array to this string buffer.

append

public void append(char appendMe)
Append a char to this string buffer.