jdk/src/share/classes/java/lang/StringBuilder.java
author alanb
Fri, 02 Nov 2012 15:50:11 +0000
changeset 14342 8435a30053c1
parent 14332 451c5dd717dc
child 14997 97d6098fd419
permissions -rw-r--r--
7197491: update copyright year to match last edit in jdk8 jdk repository Reviewed-by: chegar, ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
14342
8435a30053c1 7197491: update copyright year to match last edit in jdk8 jdk repository
alanb
parents: 14332
diff changeset
     2
 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.lang;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * A mutable sequence of characters.  This class provides an API compatible
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * with <code>StringBuffer</code>, but with no guarantee of synchronization.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * This class is designed for use as a drop-in replacement for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * <code>StringBuffer</code> in places where the string buffer was being
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * used by a single thread (as is generally the case).   Where possible,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * it is recommended that this class be used in preference to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * <code>StringBuffer</code> as it will be faster under most implementations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * <p>The principal operations on a <code>StringBuilder</code> are the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * <code>append</code> and <code>insert</code> methods, which are
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * overloaded so as to accept data of any type. Each effectively
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * converts a given datum to a string and then appends or inserts the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * characters of that string to the string builder. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * <code>append</code> method always adds these characters at the end
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * of the builder; the <code>insert</code> method adds the characters at
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * a specified point.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * For example, if <code>z</code> refers to a string builder object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * whose current contents are "<code>start</code>", then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * the method call <code>z.append("le")</code> would cause the string
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * builder to contain "<code>startle</code>", whereas
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * <code>z.insert(4, "le")</code> would alter the string builder to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * contain "<code>starlet</code>".
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * In general, if sb refers to an instance of a <code>StringBuilder</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * then <code>sb.append(x)</code> has the same effect as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * <code>sb.insert(sb.length(),&nbsp;x)</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * Every string builder has a capacity. As long as the length of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * character sequence contained in the string builder does not exceed
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * the capacity, it is not necessary to allocate a new internal
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * buffer. If the internal buffer overflows, it is automatically made larger.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * <p>Instances of <code>StringBuilder</code> are not safe for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * use by multiple threads. If such synchronization is required then it is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * recommended that {@link java.lang.StringBuffer} be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * @author      Michael McCloskey
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * @see         java.lang.StringBuffer
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * @see         java.lang.String
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * @since       1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
public final class StringBuilder
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    extends AbstractStringBuilder
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    implements java.io.Serializable, CharSequence
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    /** use serialVersionUID for interoperability */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    static final long serialVersionUID = 4383685877147921099L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * Constructs a string builder with no characters in it and an
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     * initial capacity of 16 characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    public StringBuilder() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        super(16);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * Constructs a string builder with no characters in it and an
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * initial capacity specified by the <code>capacity</code> argument.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * @param      capacity  the initial capacity.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * @throws     NegativeArraySizeException  if the <code>capacity</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     *               argument is less than <code>0</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    public StringBuilder(int capacity) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        super(capacity);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * Constructs a string builder initialized to the contents of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * specified string. The initial capacity of the string builder is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * <code>16</code> plus the length of the string argument.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * @param   str   the initial contents of the buffer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * @throws    NullPointerException if <code>str</code> is <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    public StringBuilder(String str) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        super(str.length() + 16);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        append(str);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * Constructs a string builder that contains the same characters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * as the specified <code>CharSequence</code>. The initial capacity of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * the string builder is <code>16</code> plus the length of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * <code>CharSequence</code> argument.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * @param      seq   the sequence to copy.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * @throws    NullPointerException if <code>seq</code> is <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    public StringBuilder(CharSequence seq) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        this(seq.length() + 16);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        append(seq);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   127
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    public StringBuilder append(Object obj) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        return append(String.valueOf(obj));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   132
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    public StringBuilder append(String str) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        super.append(str);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * Appends the specified <tt>StringBuffer</tt> to this sequence.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * The characters of the <tt>StringBuffer</tt> argument are appended,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * in order, to this sequence, increasing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * length of this sequence by the length of the argument.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * If <tt>sb</tt> is <tt>null</tt>, then the four characters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * <tt>"null"</tt> are appended to this sequence.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * Let <i>n</i> be the length of this character sequence just prior to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * execution of the <tt>append</tt> method. Then the character at index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * <i>k</i> in the new character sequence is equal to the character at
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * index <i>k</i> in the old character sequence, if <i>k</i> is less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * <i>n</i>; otherwise, it is equal to the character at index <i>k-n</i>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * in the argument <code>sb</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * @param   sb   the <tt>StringBuffer</tt> to append.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * @return  a reference to this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    public StringBuilder append(StringBuffer sb) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        super.append(sb);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   162
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    public StringBuilder append(CharSequence s) {
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   164
        super.append(s);
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   165
        return this;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * @throws     IndexOutOfBoundsException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   171
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    public StringBuilder append(CharSequence s, int start, int end) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        super.append(s, start, end);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   177
    @Override
1223
5c1037124466 6728229: (str) StringBuilder.append(CharSequence) does not throw IndexOutOfBoundsException
martin
parents: 2
diff changeset
   178
    public StringBuilder append(char[] str) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        super.append(str);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
1223
5c1037124466 6728229: (str) StringBuilder.append(CharSequence) does not throw IndexOutOfBoundsException
martin
parents: 2
diff changeset
   183
    /**
5c1037124466 6728229: (str) StringBuilder.append(CharSequence) does not throw IndexOutOfBoundsException
martin
parents: 2
diff changeset
   184
     * @throws IndexOutOfBoundsException {@inheritDoc}
5c1037124466 6728229: (str) StringBuilder.append(CharSequence) does not throw IndexOutOfBoundsException
martin
parents: 2
diff changeset
   185
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   186
    @Override
1223
5c1037124466 6728229: (str) StringBuilder.append(CharSequence) does not throw IndexOutOfBoundsException
martin
parents: 2
diff changeset
   187
    public StringBuilder append(char[] str, int offset, int len) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        super.append(str, offset, len);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   192
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    public StringBuilder append(boolean b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        super.append(b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   198
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    public StringBuilder append(char c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        super.append(c);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   204
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
    public StringBuilder append(int i) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        super.append(i);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   210
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    public StringBuilder append(long lng) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
        super.append(lng);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   216
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    public StringBuilder append(float f) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
        super.append(f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   222
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    public StringBuilder append(double d) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
        super.append(d);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   231
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    public StringBuilder appendCodePoint(int codePoint) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
        super.appendCodePoint(codePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * @throws StringIndexOutOfBoundsException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   240
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
    public StringBuilder delete(int start, int end) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
        super.delete(start, end);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * @throws StringIndexOutOfBoundsException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   249
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    public StringBuilder deleteCharAt(int index) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
        super.deleteCharAt(index);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * @throws StringIndexOutOfBoundsException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   258
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    public StringBuilder replace(int start, int end, String str) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
        super.replace(start, end, str);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * @throws StringIndexOutOfBoundsException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   267
    @Override
1223
5c1037124466 6728229: (str) StringBuilder.append(CharSequence) does not throw IndexOutOfBoundsException
martin
parents: 2
diff changeset
   268
    public StringBuilder insert(int index, char[] str, int offset,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
                                int len)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
        super.insert(index, str, offset, len);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     * @throws StringIndexOutOfBoundsException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   278
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
    public StringBuilder insert(int offset, Object obj) {
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   280
            super.insert(offset, obj);
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   281
            return this;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     * @throws StringIndexOutOfBoundsException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   287
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
    public StringBuilder insert(int offset, String str) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
        super.insert(offset, str);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * @throws StringIndexOutOfBoundsException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   296
    @Override
1223
5c1037124466 6728229: (str) StringBuilder.append(CharSequence) does not throw IndexOutOfBoundsException
martin
parents: 2
diff changeset
   297
    public StringBuilder insert(int offset, char[] str) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
        super.insert(offset, str);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     * @throws IndexOutOfBoundsException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   305
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
    public StringBuilder insert(int dstOffset, CharSequence s) {
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   307
            super.insert(dstOffset, s);
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   308
            return this;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     * @throws IndexOutOfBoundsException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   314
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
    public StringBuilder insert(int dstOffset, CharSequence s,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
                                int start, int end)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
        super.insert(dstOffset, s, start, end);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     * @throws StringIndexOutOfBoundsException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   325
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
    public StringBuilder insert(int offset, boolean b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
        super.insert(offset, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * @throws IndexOutOfBoundsException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   334
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
    public StringBuilder insert(int offset, char c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
        super.insert(offset, c);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     * @throws StringIndexOutOfBoundsException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   343
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
    public StringBuilder insert(int offset, int i) {
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   345
        super.insert(offset, i);
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   346
        return this;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     * @throws StringIndexOutOfBoundsException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   352
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
    public StringBuilder insert(int offset, long l) {
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   354
        super.insert(offset, l);
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   355
        return this;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     * @throws StringIndexOutOfBoundsException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   361
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
    public StringBuilder insert(int offset, float f) {
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   363
        super.insert(offset, f);
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   364
        return this;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * @throws StringIndexOutOfBoundsException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   370
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
    public StringBuilder insert(int offset, double d) {
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   372
        super.insert(offset, d);
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   373
        return this;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * @throws NullPointerException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   379
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
    public int indexOf(String str) {
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   381
        return super.indexOf(str);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     * @throws NullPointerException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   387
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
    public int indexOf(String str, int fromIndex) {
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   389
        return super.indexOf(str, fromIndex);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * @throws NullPointerException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   395
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
    public int lastIndexOf(String str) {
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   397
        return super.lastIndexOf(str);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * @throws NullPointerException {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     */
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   403
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
    public int lastIndexOf(String str, int fromIndex) {
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   405
        return super.lastIndexOf(str, fromIndex);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   408
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
    public StringBuilder reverse() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
        super.reverse();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
14332
451c5dd717dc 6206780: (str) Forwarding append methods in String{Buffer,Builder} are inconsistent
jgish
parents: 5506
diff changeset
   414
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
    public String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
        // Create a copy, don't share the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
        return new String(value, 0, count);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * Save the state of the <tt>StringBuilder</tt> instance to a stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * (that is, serialize it).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * @serialData the number of characters currently stored in the string
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     *             builder (<tt>int</tt>), followed by the characters in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     *             string builder (<tt>char[]</tt>).   The length of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     *             <tt>char</tt> array may be greater than the number of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     *             characters currently stored in the string builder, in which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     *             case extra characters are ignored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
    private void writeObject(java.io.ObjectOutputStream s)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
        throws java.io.IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
        s.defaultWriteObject();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
        s.writeInt(count);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
        s.writeObject(value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     * readObject is called to restore the state of the StringBuffer from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
     * a stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
    private void readObject(java.io.ObjectInputStream s)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
        throws java.io.IOException, ClassNotFoundException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
        s.defaultReadObject();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
        count = s.readInt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
        value = (char[]) s.readObject();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
}