Name

AbstractStringBuilder

Synopsis

This package-private class is the abstract superclass of StringBuffer and StringBuilder. Because this class is not public, you may not use it directly. It is included in this quick-reference to fully document the shared API of its two subclasses.

Note that many of the methods of this class are declared to return an AbstractStringBuilder object. StringBuilder and StringBuffer( ) override those methods and narrow the return type to StringBuilder or StringBuffer. (This is an example of "covariant returns,” which are allowed in Java 5.0 and later.)

java.lang.AbstractStringBuilder

Figure 10-2. java.lang.AbstractStringBuilder

abstract class AbstractStringBuilder implements Appendable, CharSequence {
// No Constructor
                  // Public Instance Methods
     public AbstractStringBuilder append(char[ ] str);  
     public AbstractStringBuilder append(boolean b);  
     public AbstractStringBuilder append(char c);  
     public AbstractStringBuilder append(Object obj);  
     public AbstractStringBuilder append(CharSequence s);  
     public AbstractStringBuilder append(StringBuffer sb);  
     public AbstractStringBuilder append(String str);  
     public AbstractStringBuilder append(int i);  
     public AbstractStringBuilder append(double d);  
     public AbstractStringBuilder append(float f);  
     public AbstractStringBuilder append(long l);  
     public AbstractStringBuilder append(char[ ] str, int offset, int len);  
     public AbstractStringBuilder append(CharSequence s, int ...

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.