@@ -38,15 +38,15 @@ class CharBuffer {
3838 /**
3939 * Creates a new CharBuffer with an initial capacity of 32 characters.
4040 */
41- public CharBuffer () {
41+ CharBuffer () {
4242 this (32 );
4343 }
4444
4545 /**
4646 * Creates a new CharBuffer with an initial capacity
4747 * of <code>length</code> characters.
4848 */
49- public CharBuffer (final int length ) {
49+ CharBuffer (final int length ) {
5050 if (length == 0 ) {
5151 throw new IllegalArgumentException ("Can't create an empty CharBuffer" );
5252 }
@@ -56,7 +56,7 @@ public CharBuffer(final int length) {
5656 /**
5757 * Empties the buffer. The capacity still remains the same, so no memory is freed.
5858 */
59- public void clear () {
59+ void clear () {
6060 length = 0 ;
6161 }
6262
@@ -65,7 +65,7 @@ public void clear() {
6565 *
6666 * @return the number of characters
6767 */
68- public int length () {
68+ int length () {
6969 return length ;
7070 }
7171
@@ -74,7 +74,7 @@ public int length() {
7474 *
7575 * @return the maximum number of characters that can be stored in this buffer without resizing it.
7676 */
77- public int capacity () {
77+ int capacity () {
7878 return c .length ;
7979 }
8080
@@ -84,7 +84,7 @@ public int capacity() {
8484 *
8585 * @param cb the CharBuffer to append or null
8686 */
87- public void append (final CharBuffer cb ) {
87+ void append (final CharBuffer cb ) {
8888 if (cb == null ) {
8989 return ;
9090 }
@@ -99,7 +99,7 @@ public void append(final CharBuffer cb) {
9999 *
100100 * @param s the String to append or null
101101 */
102- public void append (final String s ) {
102+ void append (final String s ) {
103103 if (s == null ) {
104104 return ;
105105 }
@@ -112,7 +112,7 @@ public void append(final String s) {
112112 *
113113 * @param data the char[] to append or null
114114 */
115- public void append (final char [] data ) {
115+ void append (final char [] data ) {
116116 if (data == null ) {
117117 return ;
118118 }
@@ -127,7 +127,7 @@ public void append(final char[] data) {
127127 *
128128 * @param data the char to append
129129 */
130- public void append (final char data ) {
130+ void append (final char data ) {
131131 provideCapacity (length + 1 );
132132 c [length ] = data ;
133133 length ++;
@@ -137,7 +137,7 @@ public void append(final char data) {
137137 * Shrinks the capacity of the buffer to the current length if necessary.
138138 * This method involves copying the data once!
139139 */
140- public void shrink () {
140+ void shrink () {
141141 if (c .length == length ) {
142142 return ;
143143 }
@@ -149,7 +149,7 @@ public void shrink() {
149149 /**
150150 * Removes trailing whitespace.
151151 */
152- public void trimTrailingWhitespace () {
152+ void trimTrailingWhitespace () {
153153 while (length > 0 && Character .isWhitespace (c [length - 1 ])) {
154154 length --;
155155 }
@@ -164,7 +164,7 @@ public void trimTrailingWhitespace() {
164164 *
165165 * @return
166166 */
167- public char [] getCharacters () {
167+ char [] getCharacters () {
168168 if (c .length == length ) {
169169 return c ;
170170 }
@@ -176,7 +176,7 @@ public char[] getCharacters() {
176176 /**
177177 * Returns the character at the specified position.
178178 */
179- public char charAt (int pos ) {
179+ char charAt (int pos ) {
180180 return c [pos ];
181181 }
182182
@@ -195,7 +195,7 @@ public String toString() {
195195 *
196196 * @param capacity
197197 */
198- public void provideCapacity (final int capacity ) {
198+ void provideCapacity (final int capacity ) {
199199 if (c .length >= capacity ) {
200200 return ;
201201 }
0 commit comments