Skip to content

Commit 1d767ad

Browse files
committed
Sort members.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1509231 13f79535-47bb-0310-9956-ffa450edef68
1 parent f69ddb3 commit 1d767ad

1 file changed

Lines changed: 30 additions & 30 deletions

File tree

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

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@
2929
*/
3030
public class CSVRecord implements Serializable, Iterable<String> {
3131

32-
private static final long serialVersionUID = 1L;
33-
3432
private static final String[] EMPTY_STRING_ARRAY = new String[0];
3533

36-
/** The values of the record */
37-
private final String[] values;
38-
39-
/** The column name to index mapping. */
40-
private final Map<String, Integer> mapping;
34+
private static final long serialVersionUID = 1L;
4135

4236
/** The accumulated comments (if any) */
4337
private final String comment;
4438

39+
/** The column name to index mapping. */
40+
private final Map<String, Integer> mapping;
41+
4542
/** The record number. */
4643
private final long recordNumber;
4744

45+
/** The values of the record */
46+
private final String[] values;
47+
4848
CSVRecord(final String[] values, final Map<String, Integer> mapping,
4949
final String comment, final long recordNumber) {
5050
this.recordNumber = recordNumber;
@@ -103,6 +103,25 @@ public String get(final String name) {
103103
}
104104
}
105105

106+
/**
107+
* Returns the comment for this record, if any.
108+
*
109+
* @return the comment for this record, or null if no comment for this
110+
* record is available.
111+
*/
112+
public String getComment() {
113+
return comment;
114+
}
115+
116+
/**
117+
* Returns the number of this record in the parsed CSV file.
118+
*
119+
* @return the number of this record.
120+
*/
121+
public long getRecordNumber() {
122+
return recordNumber;
123+
}
124+
106125
/**
107126
* Returns true if this record is consistent, false if not. Currently, the only check is matching the record size to
108127
* the header size. Some programs can export files that fails this test but still produce parsable files.
@@ -145,29 +164,6 @@ public Iterator<String> iterator() {
145164
return Arrays.asList(values).iterator();
146165
}
147166

148-
String[] values() {
149-
return values;
150-
}
151-
152-
/**
153-
* Returns the comment for this record, if any.
154-
*
155-
* @return the comment for this record, or null if no comment for this
156-
* record is available.
157-
*/
158-
public String getComment() {
159-
return comment;
160-
}
161-
162-
/**
163-
* Returns the number of this record in the parsed CSV file.
164-
*
165-
* @return the number of this record.
166-
*/
167-
public long getRecordNumber() {
168-
return recordNumber;
169-
}
170-
171167
/**
172168
* Returns the number of values in this record.
173169
*
@@ -182,5 +178,9 @@ public String toString() {
182178
return Arrays.toString(values);
183179
}
184180

181+
String[] values() {
182+
return values;
183+
}
184+
185185

186186
}

0 commit comments

Comments
 (0)