Skip to content

Commit 6640e85

Browse files
committed
Standardise on record rather than line; fix incorrect Javadoc comments
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1468827 13f79535-47bb-0310-9956-ffa450edef68
1 parent 939a8a0 commit 6640e85

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/main/java/org/apache/commons/csv/CSVPrinter.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public class CSVPrinter implements Flushable, Closeable {
4040
private final Appendable out;
4141
private final CSVFormat format;
4242

43-
/** True if we just began a new line. */
44-
private boolean newLine = true;
43+
/** True if we just began a new record. */
44+
private boolean newRecord = true;
4545

4646
/**
4747
* Creates a printer that will print values to the given stream following the CSVFormat.
@@ -66,14 +66,14 @@ public CSVPrinter(final Appendable out, final CSVFormat format) {
6666
// ======================================================
6767

6868
/**
69-
* Outputs the line separator.
69+
* Outputs the record separator.
7070
*
7171
* @throws IOException
7272
* If an I/O error occurs
7373
*/
7474
public void println() throws IOException {
7575
out.append(format.getRecordSeparator());
76-
newLine = true;
76+
newRecord = true;
7777
}
7878

7979
/**
@@ -136,7 +136,7 @@ public void printComment(final String comment) throws IOException {
136136
if (!format.isCommentingEnabled()) {
137137
return;
138138
}
139-
if (!newLine) {
139+
if (!newRecord) {
140140
println();
141141
}
142142
out.append(format.getCommentStart().charValue());
@@ -175,8 +175,8 @@ private void print(final Object object, final CharSequence value,
175175
}
176176

177177
void printDelimiter() throws IOException {
178-
if (newLine) {
179-
newLine = false;
178+
if (newRecord) {
179+
newRecord = false;
180180
} else {
181181
out.append(format.getDelimiter());
182182
}
@@ -228,7 +228,7 @@ void printAndEscape(final CharSequence value, final int offset, final int len) t
228228
*/
229229
void printAndQuote(final Object object, final CharSequence value,
230230
final int offset, final int len) throws IOException {
231-
final boolean first = newLine; // is this the first value on this line?
231+
final boolean first = newRecord; // is this the first value on this line?
232232
boolean quote = false;
233233
int start = offset;
234234
int pos = offset;

0 commit comments

Comments
 (0)