Top Description Inners Fields Constructors Methods
de.siegmar.fastcsv.reader

public final Record CsvIndex

extends Record
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Record Components
bomHeaderLength:int
The length of an optional BOM header.
fileSize:long
The CSV file size this index was built for.
fieldSeparator:byte
The field separator used when building this index.
quoteCharacter:byte
The quote character used when building this index.
commentStrategy:CommentStrategy
The comment strategy used when building this index.
commentCharacter:byte
The comment character used when building this index.
recordCount:long
The total number of records the CSV file contains this index was built for.
pages:List<CsvIndex.CsvPage>
The pages this index is partitioned.
Imports
java.io.Serializable, java.util.List, .Objects, .StringJoiner

Index built by IndexedCsvReader to access large CSV data files.

Even if the constructor is public (mandatory for record classes), this class is not intended to be instantiated directly!

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static record
CsvIndex.CsvPage

Represents a page of the CSV file.

Field Summary

Modifier and TypeField and Description
private final int
bomHeaderLength

Record Component accessed by bomHeaderLength().

The length of an optional BOM header.
private final byte
commentCharacter

Record Component accessed by commentCharacter().

The comment character used when building this index.
private final CommentStrategy
commentStrategy

Record Component accessed by commentStrategy().

The comment strategy used when building this index.
private final byte
fieldSeparator

Record Component accessed by fieldSeparator().

The field separator used when building this index.
private final long
fileSize

Record Component accessed by fileSize().

The CSV file size this index was built for.
private final List<CsvIndex.CsvPage>
pages

Record Component accessed by pages().

The pages this index is partitioned.
private final byte
quoteCharacter

Record Component accessed by quoteCharacter().

The quote character used when building this index.
private final long
recordCount

Record Component accessed by recordCount().

The total number of records the CSV file contains this index was built for.

Constructor Summary

AccessConstructor and Description
public
CsvIndex(final int bomHeaderLength, final long fileSize, final byte fieldSeparator, final byte quoteCharacter, final CommentStrategy commentStrategy, final byte commentCharacter, final long recordCount, final List<CsvIndex.CsvPage> pages)

Constructor for the CsvIndex class.

Method Summary

Modifier and TypeMethod and Description
public int
bomHeaderLength()

Record Component getter of bomHeaderLength.

Record Component The length of an optional BOM header.

public byte
commentCharacter()

Record Component getter of commentCharacter.

Record Component The comment character used when building this index.

public CommentStrategy
commentStrategy()

Record Component getter of commentStrategy.

Record Component The comment strategy used when building this index.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public byte
fieldSeparator()

Record Component getter of fieldSeparator.

Record Component The field separator used when building this index.

public long
fileSize()

Record Component getter of fileSize.

Record Component The CSV file size this index was built for.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public List<CsvIndex.CsvPage>
pages()

Record Component getter of pages.

Record Component The pages this index is partitioned.

public byte
quoteCharacter()

Record Component getter of quoteCharacter.

Record Component The quote character used when building this index.

public long
recordCount()

Record Component getter of recordCount.

Record Component The total number of records the CSV file contains this index was built for.

public String

Returns:

string representation of this index without the pages themselves
toString
()

Implements abstract java.lang.Record.toString.

Returns string representation of this index without the pages themselves.

Field Detail

bomHeaderLengthback to summary
private final int bomHeaderLength

Record Component accessed by bomHeaderLength().

The length of an optional BOM header.

commentCharacterback to summary
private final byte commentCharacter

Record Component accessed by commentCharacter().

The comment character used when building this index.

commentStrategyback to summary
private final CommentStrategy commentStrategy

Record Component accessed by commentStrategy().

The comment strategy used when building this index.

fieldSeparatorback to summary
private final byte fieldSeparator

Record Component accessed by fieldSeparator().

The field separator used when building this index.

fileSizeback to summary
private final long fileSize

Record Component accessed by fileSize().

The CSV file size this index was built for.

pagesback to summary
private final List<CsvIndex.CsvPage> pages

Record Component accessed by pages().

The pages this index is partitioned.

quoteCharacterback to summary
private final byte quoteCharacter

Record Component accessed by quoteCharacter().

The quote character used when building this index.

recordCountback to summary
private final long recordCount

Record Component accessed by recordCount().

The total number of records the CSV file contains this index was built for.

Constructor Detail

CsvIndexback to summary
public CsvIndex(final int bomHeaderLength, final long fileSize, final byte fieldSeparator, final byte quoteCharacter, final CommentStrategy commentStrategy, final byte commentCharacter, final long recordCount, final List<CsvIndex.CsvPage> pages)

Constructor for the CsvIndex class.

Annotations
@SuppressWarnings:checkstyle:ParameterNumber
Exceptions
NullPointerException:
if the commentStrategy or pages is null

Method Detail

bomHeaderLengthback to summary
public int bomHeaderLength()

Record Component getter of bomHeaderLength.

Record Component
The length of an optional BOM header.
commentCharacterback to summary
public byte commentCharacter()

Record Component getter of commentCharacter.

Record Component
The comment character used when building this index.
commentStrategyback to summary
public CommentStrategy commentStrategy()

Record Component getter of commentStrategy.

Record Component
The comment strategy used when building this index.
equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
fieldSeparatorback to summary
public byte fieldSeparator()

Record Component getter of fieldSeparator.

Record Component
The field separator used when building this index.
fileSizeback to summary
public long fileSize()

Record Component getter of fileSize.

Record Component
The CSV file size this index was built for.
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

pagesback to summary
public List<CsvIndex.CsvPage> pages()

Record Component getter of pages.

Record Component
The pages this index is partitioned.
quoteCharacterback to summary
public byte quoteCharacter()

Record Component getter of quoteCharacter.

Record Component
The quote character used when building this index.
recordCountback to summary
public long recordCount()

Record Component getter of recordCount.

Record Component
The total number of records the CSV file contains this index was built for.
toStringback to summary
public String toString()

Implements abstract java.lang.Record.toString.

Returns string representation of this index without the pages themselves.

Returns:String

string representation of this index without the pages themselves

Annotations
@Override
de.siegmar.fastcsv.reader back to summary

public final Record CsvIndex.CsvPage

extends Record
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Record Components
offset:long
The offset of the page in the CSV file.
startingLineNumber:long
The starting line number of the page.

Represents a page of the CSV file.

Field Summary

Modifier and TypeField and Description
private final long
offset

Record Component accessed by offset().

The offset of the page in the CSV file.
private final long
startingLineNumber

Record Component accessed by startingLineNumber().

The starting line number of the page.

Constructor Summary

AccessConstructor and Description
public
CsvPage(long offset, long startingLineNumber)

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public long
offset()

Record Component getter of offset.

Record Component The offset of the page in the CSV file.

public long
startingLineNumber()

Record Component getter of startingLineNumber.

Record Component The starting line number of the page.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

offsetback to summary
private final long offset

Record Component accessed by offset().

The offset of the page in the CSV file.

startingLineNumberback to summary
private final long startingLineNumber

Record Component accessed by startingLineNumber().

The starting line number of the page.

Constructor Detail

CsvPageback to summary
public CsvPage(long offset, long startingLineNumber)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

offsetback to summary
public long offset()

Record Component getter of offset.

Record Component
The offset of the page in the CSV file.
startingLineNumberback to summary
public long startingLineNumber()

Record Component getter of startingLineNumber.

Record Component
The starting line number of the page.
toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.