You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by eb...@apache.org on 2012/03/06 22:00:44 UTC
svn commit: r1297719 - in
/commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv:
CharBuffer.java ExtendedBufferedReader.java
Author: ebourg
Date: Tue Mar 6 21:00:44 2012
New Revision: 1297719
URL: http://svn.apache.org/viewvc?rev=1297719&view=rev
Log:
Made all public methods in CharBuffer and ExtendedBufferedReader package private
Modified:
commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CharBuffer.java
commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/ExtendedBufferedReader.java
Modified: commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CharBuffer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CharBuffer.java?rev=1297719&r1=1297718&r2=1297719&view=diff
==============================================================================
--- commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CharBuffer.java (original)
+++ commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CharBuffer.java Tue Mar 6 21:00:44 2012
@@ -38,7 +38,7 @@ class CharBuffer {
/**
* Creates a new CharBuffer with an initial capacity of 32 characters.
*/
- public CharBuffer() {
+ CharBuffer() {
this(32);
}
@@ -46,7 +46,7 @@ class CharBuffer {
* Creates a new CharBuffer with an initial capacity
* of <code>length</code> characters.
*/
- public CharBuffer(final int length) {
+ CharBuffer(final int length) {
if (length == 0) {
throw new IllegalArgumentException("Can't create an empty CharBuffer");
}
@@ -56,7 +56,7 @@ class CharBuffer {
/**
* Empties the buffer. The capacity still remains the same, so no memory is freed.
*/
- public void clear() {
+ void clear() {
length = 0;
}
@@ -65,7 +65,7 @@ class CharBuffer {
*
* @return the number of characters
*/
- public int length() {
+ int length() {
return length;
}
@@ -74,7 +74,7 @@ class CharBuffer {
*
* @return the maximum number of characters that can be stored in this buffer without resizing it.
*/
- public int capacity() {
+ int capacity() {
return c.length;
}
@@ -84,7 +84,7 @@ class CharBuffer {
*
* @param cb the CharBuffer to append or null
*/
- public void append(final CharBuffer cb) {
+ void append(final CharBuffer cb) {
if (cb == null) {
return;
}
@@ -99,7 +99,7 @@ class CharBuffer {
*
* @param s the String to append or null
*/
- public void append(final String s) {
+ void append(final String s) {
if (s == null) {
return;
}
@@ -112,7 +112,7 @@ class CharBuffer {
*
* @param data the char[] to append or null
*/
- public void append(final char[] data) {
+ void append(final char[] data) {
if (data == null) {
return;
}
@@ -127,7 +127,7 @@ class CharBuffer {
*
* @param data the char to append
*/
- public void append(final char data) {
+ void append(final char data) {
provideCapacity(length + 1);
c[length] = data;
length++;
@@ -137,7 +137,7 @@ class CharBuffer {
* Shrinks the capacity of the buffer to the current length if necessary.
* This method involves copying the data once!
*/
- public void shrink() {
+ void shrink() {
if (c.length == length) {
return;
}
@@ -149,7 +149,7 @@ class CharBuffer {
/**
* Removes trailing whitespace.
*/
- public void trimTrailingWhitespace() {
+ void trimTrailingWhitespace() {
while (length > 0 && Character.isWhitespace(c[length - 1])) {
length--;
}
@@ -164,7 +164,7 @@ class CharBuffer {
*
* @return
*/
- public char[] getCharacters() {
+ char[] getCharacters() {
if (c.length == length) {
return c;
}
@@ -176,7 +176,7 @@ class CharBuffer {
/**
* Returns the character at the specified position.
*/
- public char charAt(int pos) {
+ char charAt(int pos) {
return c[pos];
}
@@ -195,7 +195,7 @@ class CharBuffer {
*
* @param capacity
*/
- public void provideCapacity(final int capacity) {
+ void provideCapacity(final int capacity) {
if (c.length >= capacity) {
return;
}
Modified: commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/ExtendedBufferedReader.java
URL: http://svn.apache.org/viewvc/commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/ExtendedBufferedReader.java?rev=1297719&r1=1297718&r2=1297719&view=diff
==============================================================================
--- commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/ExtendedBufferedReader.java (original)
+++ commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/ExtendedBufferedReader.java Tue Mar 6 21:00:44 2012
@@ -34,10 +34,10 @@ import java.io.Reader;
class ExtendedBufferedReader extends BufferedReader {
/** The end of stream symbol */
- public static final int END_OF_STREAM = -1;
+ static final int END_OF_STREAM = -1;
/** Undefined state for the lookahead char */
- public static final int UNDEFINED = -2;
+ static final int UNDEFINED = -2;
/** The lookahead chars */
private int lookaheadChar = UNDEFINED;
@@ -53,7 +53,7 @@ class ExtendedBufferedReader extends Buf
/**
* Created extended buffered reader using default buffer-size
*/
- public ExtendedBufferedReader(Reader r) {
+ ExtendedBufferedReader(Reader r) {
super(r);
/* note uh: do not fetch the first char here,
* because this might block the method!
@@ -87,7 +87,7 @@ class ExtendedBufferedReader extends Buf
*
* @return the last read char or UNDEFINED
*/
- public int readAgain() {
+ int readAgain() {
return lastChar;
}
@@ -198,7 +198,7 @@ class ExtendedBufferedReader extends Buf
*
* @return the next char (without consuming it) or END_OF_STREAM
*/
- public int lookAhead() throws IOException {
+ int lookAhead() throws IOException {
if (lookaheadChar == UNDEFINED) {
lookaheadChar = super.read();
}
@@ -211,12 +211,8 @@ class ExtendedBufferedReader extends Buf
*
* @return the current-line-number (or -1)
*/
- public int getLineNumber() {
- if (lineCounter > -1) {
- return lineCounter;
- } else {
- return -1;
- }
+ int getLineNumber() {
+ return lineCounter > -1 ? lineCounter : -1;
}
/**