qx.util
Class StringBuilder

java.lang.Object
  extended by qx.util.StringBuilder

public class StringBuilder
extends java.lang.Object

A string builder class

+= operator is faster in Firefox and Opera. Array push/join is faster in Internet Explorer

Even with this wrapper, which costs some time, this is faster in Firefox than the alternative Array concat in all browsers (which is in relation to IE’s performance issues only marginal). The IE performance loss caused by this wrapper is not relevant.

So this class seems to be the best compromise to handle string concatenation.


Constructor Summary
StringBuilder()
           
StringBuilder(java.lang.String varargs)
           
 
Method Summary
 void add(java.lang.String varargs)
          Append a variable number of string arguments.
 void clear()
          Resets the contents of the Stringbuilder equivalent to
 java.lang.String get()
          Returns the contents of the concatenated string
 void init()
          Initializes the contents of the Stringbuilder equivalent to
 boolean isEmpty()
          Checks whether the strinb builder instance represents the epty string.
 java.lang.String toString_()
          Returns the contents of the concatenated string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringBuilder

public StringBuilder()

StringBuilder

public StringBuilder(java.lang.String varargs)
Method Detail

add

public void add(java.lang.String varargs)

Append a variable number of string arguments. To only append one use #addOne instead.


clear

public void clear()

Resets the contents of the Stringbuilder equivalent to

str = ""; 


get

public java.lang.String get()

Returns the contents of the concatenated string


init

public void init()

Initializes the contents of the Stringbuilder equivalent to

str = ""; 


isEmpty

public boolean isEmpty()

Checks whether the strinb builder instance represents the epty string.


toString_

public java.lang.String toString_()

Returns the contents of the concatenated string



Copyright © 2008 1&1. All Rights Reserved.