Note
Support for Serializable is scheduled to be removed in version 2.0.
In version 1.8 the mapping between the column header and the column index was
removed from the serialized state. The class maintains serialization compatibility
with versions pre-1.8 for the record values; these must be accessed by index
following deserialization. There will be a loss of any functionally linked to the header
mapping when transferring serialized forms pre-1.8 to 1.8 and vice versa.
| Modifier and Type | Field and Description |
|---|---|
| private final long | bytePosition
The starting position of this record in the source stream, measured in bytes. |
| private final long | characterPosition
The start position of this record as a character position in the source stream. |
| private final String | comment
The accumulated comments (if any) |
| private final transient CSVParser | parser
The parser that originates this record. |
| private final long | recordNumber
The record number. |
| private static final long | |
| private final String[] | values
The values of the record |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| public String | Returns: the String at the given indexa column index (0-based) i)Returns a value by index. |
| public String | Returns: the column value, maybe null depending onCSVFormat#getNullString().the name of the column to be retrieved. name)Returns a value by name. |
| public long | Returns: the byte position of this record in the source stream.Returns the starting position of this record in the source stream, measured in bytes. |
| public long | Returns: the position of this record in the source stream.Returns the start position of this record as a character position in the source stream. |
| public String | Returns: the comment for this record, or null if no comment for this record is available.Returns the comment for this record, if any. |
| private Map | |
| public CSVParser | |
| public long | Returns: the number of this record.Returns the number of this record in the parsed CSV file. |
| public boolean | Returns: true if this record has a comment, false otherwiseChecks whether this record has a comment, false otherwise. |
| public boolean | Returns: true of this record is valid, false if notTells whether the record size matches the header size. |
| public boolean | |
| public boolean | Returns: whether a column with a given index has a valuea column index (0-based) index)Checks whether a column with a given index has a value. |
| public boolean | |
| public Iterator | Returns: an iterator over the values of this record.Implements java. Returns an iterator over the values of this record. |
| public < the map type M extends Map | Returns: the given map.The Map to populate. map)Puts all values of this record into the given Map. |
| public int | |
| public Stream | |
| public List | |
| public Map | Returns: A new Map. The map is empty if the record has no headers.Copies this record into a new Map of header name to record value. |
| public String | Returns: a String representation of this record.Overrides java. Returns a string representation of the contents of this record. |
| public String[] |
| bytePosition | back to summary |
|---|---|
| private final long bytePosition The starting position of this record in the source stream, measured in bytes. | |
| characterPosition | back to summary |
|---|---|
| private final long characterPosition The start position of this record as a character position in the source stream. This may or may not correspond to the byte position depending on the character set. | |
| comment | back to summary |
|---|---|
| private final String comment The accumulated comments (if any) | |
| parser | back to summary |
|---|---|
| private final transient CSVParser parser The parser that originates this record. This is not serialized. | |
| recordNumber | back to summary |
|---|---|
| private final long recordNumber The record number. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| values | back to summary |
|---|---|
| private final String[] values The values of the record | |
| CSVRecord | back to summary |
|---|---|
| pack-priv CSVRecord(final CSVParser parser, final String[] values, final String comment, final long recordNumber, final long characterPosition, final long bytePosition) | |
| get | back to summary |
|---|---|
| public String get(final Enum<?> e) Returns a value by | |
| get | back to summary |
|---|---|
| public String get(final int i) Returns a value by index.
| |
| get | back to summary |
|---|---|
| public String get(final String name) Returns a value by name. If multiple instances of the header name exists, only the last occurrence is returned. Note This requires a field mapping obtained from the original parser.
A check using
| |
| getBytePosition | back to summary |
|---|---|
| public long getBytePosition() Returns the starting position of this record in the source stream, measured in bytes.
| |
| getCharacterPosition | back to summary |
|---|---|
| public long getCharacterPosition() Returns the start position of this record as a character position in the source stream. This may or may not correspond to the byte position depending on the character set.
| |
| getComment | back to summary |
|---|---|
| public String getComment() Returns the comment for this record, if any. Note that comments are attached to the following record. If there is no following record (that is, the comment is at EOF), then the comment will be ignored.
| |
| getHeaderMapRaw | back to summary |
|---|---|
| private Map | |
| getParser | back to summary |
|---|---|
| public CSVParser getParser() Returns the parser. Note The parser is not part of the serialized state of the record. A null check should be used when the record may have originated from a serialized form.
| |
| getRecordNumber | back to summary |
|---|---|
| public long getRecordNumber() Returns the number of this record in the parsed CSV file. Note If your CSV input has multi-line values, the returned number does not correspond to the current line number of the parser that created this record.
| |
| hasComment | back to summary |
|---|---|
| public boolean hasComment() Checks whether this record has a comment, false otherwise. Note that comments are attached to the following record. If there is no following record (that is, the comment is at EOF), then the comment will be ignored.
| |
| isConsistent | back to summary |
|---|---|
| public boolean isConsistent() Tells whether the record size matches the header size. Returns true if the sizes for this record match and false if not. Some programs can export files that fail this test but still produce parsable files.
| |
| isMapped | back to summary |
|---|---|
| public boolean isMapped(final String name) Checks whether a given column is mapped, that is, its name has been defined to the parser.
| |
| isSet | back to summary |
|---|---|
| public boolean isSet(final int index) Checks whether a column with a given index has a value.
| |
| isSet | back to summary |
|---|---|
| public boolean isSet(final String name) Checks whether a given column is mapped and has a value.
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Returns an iterator over the values of this record. | |
| putIn | back to summary |
|---|---|
| public <M extends Map Puts all values of this record into the given Map.
| |
| size | back to summary |
|---|---|
| public int size() Returns the number of values in this record.
| |
| stream | back to summary |
|---|---|
| public Stream Returns a sequential ordered stream whose elements are the values. | |
| toList | back to summary |
|---|---|
| public List Converts the values to a new List. Editing the list does not update this instance. | |
| toMap | back to summary |
|---|---|
| public Map Copies this record into a new Map of header name to record value. If multiple instances of a header name exist, then only the last occurrence is mapped. Editing the map does not update this instance. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of the contents of this record. The result is constructed by comment, mapping,
recordNumber and by passing the internal values array to | |
| values | back to summary |
|---|---|
| public String[] values() Gets the values for this record. This is not a copy.
| |