Sort members.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1509231 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f69ddb394a
commit
1d767ad946
|
@ -29,22 +29,22 @@ import java.util.Map;
|
||||||
*/
|
*/
|
||||||
public class CSVRecord implements Serializable, Iterable<String> {
|
public class CSVRecord implements Serializable, Iterable<String> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final String[] EMPTY_STRING_ARRAY = new String[0];
|
private static final String[] EMPTY_STRING_ARRAY = new String[0];
|
||||||
|
|
||||||
/** The values of the record */
|
private static final long serialVersionUID = 1L;
|
||||||
private final String[] values;
|
|
||||||
|
|
||||||
/** The column name to index mapping. */
|
|
||||||
private final Map<String, Integer> mapping;
|
|
||||||
|
|
||||||
/** The accumulated comments (if any) */
|
/** The accumulated comments (if any) */
|
||||||
private final String comment;
|
private final String comment;
|
||||||
|
|
||||||
|
/** The column name to index mapping. */
|
||||||
|
private final Map<String, Integer> mapping;
|
||||||
|
|
||||||
/** The record number. */
|
/** The record number. */
|
||||||
private final long recordNumber;
|
private final long recordNumber;
|
||||||
|
|
||||||
|
/** The values of the record */
|
||||||
|
private final String[] values;
|
||||||
|
|
||||||
CSVRecord(final String[] values, final Map<String, Integer> mapping,
|
CSVRecord(final String[] values, final Map<String, Integer> mapping,
|
||||||
final String comment, final long recordNumber) {
|
final String comment, final long recordNumber) {
|
||||||
this.recordNumber = recordNumber;
|
this.recordNumber = recordNumber;
|
||||||
|
@ -103,6 +103,25 @@ public class CSVRecord implements Serializable, Iterable<String> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the comment for this record, if any.
|
||||||
|
*
|
||||||
|
* @return the comment for this record, or null if no comment for this
|
||||||
|
* record is available.
|
||||||
|
*/
|
||||||
|
public String getComment() {
|
||||||
|
return comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the number of this record in the parsed CSV file.
|
||||||
|
*
|
||||||
|
* @return the number of this record.
|
||||||
|
*/
|
||||||
|
public long getRecordNumber() {
|
||||||
|
return recordNumber;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this record is consistent, false if not. Currently, the only check is matching the record size to
|
* Returns true if this record is consistent, false if not. Currently, the only check is matching the record size to
|
||||||
* the header size. Some programs can export files that fails this test but still produce parsable files.
|
* the header size. Some programs can export files that fails this test but still produce parsable files.
|
||||||
|
@ -145,29 +164,6 @@ public class CSVRecord implements Serializable, Iterable<String> {
|
||||||
return Arrays.asList(values).iterator();
|
return Arrays.asList(values).iterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] values() {
|
|
||||||
return values;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the comment for this record, if any.
|
|
||||||
*
|
|
||||||
* @return the comment for this record, or null if no comment for this
|
|
||||||
* record is available.
|
|
||||||
*/
|
|
||||||
public String getComment() {
|
|
||||||
return comment;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the number of this record in the parsed CSV file.
|
|
||||||
*
|
|
||||||
* @return the number of this record.
|
|
||||||
*/
|
|
||||||
public long getRecordNumber() {
|
|
||||||
return recordNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of values in this record.
|
* Returns the number of values in this record.
|
||||||
*
|
*
|
||||||
|
@ -182,5 +178,9 @@ public class CSVRecord implements Serializable, Iterable<String> {
|
||||||
return Arrays.toString(values);
|
return Arrays.toString(values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String[] values() {
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue