com.google.gwt.core.client.impl
Class StringBuilderImpl

java.lang.Object
  extended by com.google.gwt.core.client.impl.StringBuilderImpl
Direct Known Subclasses:
StringBuilderImpl.ImplArray, StringBuilderImpl.ImplPush, StringBuilderImpl.ImplStringAppend

public class StringBuilderImpl
extends java.lang.Object

An implementation for a StringBuilder or StringBuffer. This class holds a default implementation based on an array of strings and the JavaScript join function. Deferred bindings can substitute a subclass optimized for a particular browser.

The main implementations are static classes nested within this one. All of the implementations have been carefully tweaked to get the most inlining possible, so be sure to check with StringBuilderBenchmark whenever these classes are modified.


Nested Class Summary
static class StringBuilderImpl.ImplArray
          A StringBuilderImpl that uses an array and an explicit length for appending strings.
static class StringBuilderImpl.ImplPush
          A StringBuilderImpl that uses push for appending strings.
static class StringBuilderImpl.ImplStringAppend
          A StringBuilderImpl that uses += for appending strings.
 
Constructor Summary
StringBuilderImpl()
           
 
Method Summary
 void append(java.lang.String toAppend)
           
 int length()
           
 void replace(int start, int end, java.lang.String toInsert)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringBuilderImpl

public StringBuilderImpl()
Method Detail

append

public void append(java.lang.String toAppend)

length

public int length()

replace

public void replace(int start,
                    int end,
                    java.lang.String toInsert)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object