|
20 | 20 | package org.apache.commons.csv; |
21 | 21 |
|
22 | 22 | /** |
23 | | - * A simple StringBuffer replacement that aims to |
24 | | - * reduce copying as much as possible. The buffer |
25 | | - * grows as necessary. |
26 | | - * This class is not thread safe. |
| 23 | + * A simple StringBuffer replacement that aims to reduce copying as much as possible. |
| 24 | + * The buffer grows as necessary. This class is not thread safe. |
27 | 25 | * |
28 | | - * @author Ortwin Gl�ck |
| 26 | + * @author Ortwin Glück |
29 | 27 | */ |
30 | 28 | class CharBuffer { |
31 | 29 |
|
32 | 30 | private char[] c; |
33 | 31 |
|
34 | 32 | /** |
35 | 33 | * Actually used number of characters in the array. |
36 | | - * It is also the index at which |
37 | | - * a new character will be inserted into <code>c</code>. |
| 34 | + * It is also the index at which a new character will be inserted into <code>c</code>. |
38 | 35 | */ |
39 | 36 | private int length; |
40 | 37 |
|
@@ -75,8 +72,7 @@ public int length() { |
75 | 72 | /** |
76 | 73 | * Returns the current capacity of the buffer. |
77 | 74 | * |
78 | | - * @return the maximum number of characters that can be stored in this buffer without |
79 | | - * resizing it. |
| 75 | + * @return the maximum number of characters that can be stored in this buffer without resizing it. |
80 | 76 | */ |
81 | 77 | public int capacity() { |
82 | 78 | return c.length; |
@@ -110,21 +106,6 @@ public void append(final String s) { |
110 | 106 | append(s.toCharArray()); |
111 | 107 | } |
112 | 108 |
|
113 | | - /** |
114 | | - * Appends <code>sb</code> to the end of this CharBuffer. |
115 | | - * This method involves copying the new data once! |
116 | | - * |
117 | | - * @param sb the StringBuffer to append or null |
118 | | - */ |
119 | | - public void append(final StringBuffer sb) { |
120 | | - if (sb == null) { |
121 | | - return; |
122 | | - } |
123 | | - provideCapacity(length + sb.length()); |
124 | | - sb.getChars(0, sb.length(), c, length); |
125 | | - length += sb.length(); |
126 | | - } |
127 | | - |
128 | 109 | /** |
129 | 110 | * Appends <code>data</code> to the end of this CharBuffer. |
130 | 111 | * This method involves copying the new data once! |
@@ -199,18 +180,6 @@ public char charAt(int pos) { |
199 | 180 | return c[pos]; |
200 | 181 | } |
201 | 182 |
|
202 | | - /** |
203 | | - * Converts the contents of the buffer into a StringBuffer. |
204 | | - * This method involves copying the new data once! |
205 | | - * |
206 | | - * @return |
207 | | - */ |
208 | | - public StringBuffer toStringBuffer() { |
209 | | - StringBuffer sb = new StringBuffer(length); |
210 | | - sb.append(c, 0, length); |
211 | | - return sb; |
212 | | - } |
213 | | - |
214 | 183 | /** |
215 | 184 | * Converts the contents of the buffer into a StringBuffer. |
216 | 185 | * This method involves copying the new data once! |
|
0 commit comments