Package org.refcodes.tabular
Column:
Similar to a column definition
for a DB or a spread sheet (or, with reservations, a CSV file), a
Column describes properties such as name (key)
and type of elements related to that Column
(e.g. the according elements of the Row lines).
Header:
A list of
Column instances, for example describing the
elements of a CSV file (visually speaking the of the CSV file's header line),
is represented by the Header. The
Header preserves an order for a list of
Column instances. A
Header provides the semantics for related
Row instances.
Header:
In case no order of the
Column instances is explicitly required (similar
to a DB table or a spread sheet, in contrast to a CSV file) then
Column instances are grouped by a
Header set.
Header provide additional semantics to the
Field instances stored in a
Record.
Row:
A Row
holds multiple data elements loosely coupled to a
Header. As a Row
just contains a list of data elements with no keys (names) directly
associated to the elements, a Header with the
according list of key (name) and type definitions is required to give a
Row its semantics.
In terms of a CSV file, a Row represents a
single line of comma separated values. The
Header stands for the header line (top line) of
the CSV file. The semantics for the content of a
Row is provided by the according
Header.
Many Row instances are contained in a
Rows instance which in turn requires a single
Header to give all the therein contained
Row instances their semantics (in terms of key
(name) and type information).
In contrast to a Row, a
Record relates an element field with a key
(name), called Field.
In contrast to a Record, a
Row does not relate a key (name) to its values.
To do this, a Header is required. Similar to a
Record, a Row makes
use of Column instances (provided by a
Header instance) to give the fields additional
semantics.
Rows:
A bunch of
Row instances is represented by a
Rows instance. As of efficiency reasons, a
Rows instance can be iterated through, returning
a single Row within each iteration. This
approach is making it possible to query a DB in the background and just hold
the Row instances being served next in the
Rows instance (in memory).
The way how Rows instances manage their related
Row instances is implementation specific, a
plain java implementation might use some kind of collection for storing the
Row instances (this can get memory intensive and
not applicable when working with big data). A DB implementation might
retrieve the Row instances in blocks one by one,
one after the other, by querying the DB accordingly (in terms of "next"
result sets).
Record:
A
Record is a Map containing
Field data structures with support for
Column definitions. The
Field instances can be managed with the
functionality provided by a Column.
A value can be retrieved from a Record by
providing an according Column definition, which
verifies the value type. Also values can be converted to and from the
appropriate interchange and string formats by the according
Column instances.
In contrast to a Row, a
Record relates the key (name) to its values.
Similar to a Row, a
Record makes use of
Column instances (for example as provided by a
Header or a Header
instance) to give the fields additional semantics.
Records:
A bunch of
Record instances is represented by a
Records instance. As of efficiency reasons, a
Records instance can be iterated through,
returning a single Record within each iteration.
This approach is making it possible to query a DB in the background and just
hold the Record instances being served next in
the Records instance (in memory).
The way how Records instances manage their
related Record instances is implementation
specific, a plain java implementation might use some kind of collection for
storing the Record instances (this can get
memory intensive and not applicable when working with big data). A DB
implementation might retrieve the Record
instances in blocks one by one, one after the other, by querying the DB
accordingly (in terms of "next" result sets).
-
Interface Summary Interface Description Column<T> ColumnAccessor<T> Provides an accessor for aColumnproperty.ColumnAccessor.ColumnMutator<T> Provides a mutator for aColumnproperty.ColumnAccessor.ColumnProperty<T> Provides aColumnproperty.ColumnFactory<T> AColumnFactorycreates or retrieves aColumninstances identified by the provided key (name).ColumnRow<T,C extends Column<? extends T>> Columns<T> Field<T> AFieldstores an attribute consisting of a key (name) and a value.Fields<T> AFieldsstores an attribute consisting of a key (name) and an array of values.FormattedColumn<T> Enriches aColumnwith rendering metrics (as of theColumnSetupMetrics) mostly for text-based output such as for generating output for a terminal / console.FormattedColumns<T> In case no order of theFormattedColumninstances is explicitly required (similar to a DB table or a spread sheet, in contrast to a CSV file) thenFormattedColumninstances are grouped by aFormattedColumnsset.Header<T> HeaderAccessor<T> Provides an accessor for aHeaderproperty.HeaderAccessor.HeaderBuilder<T extends HeaderAccessor.HeaderBuilder<?>> Provides a mutator for an header property.HeaderAccessor.HeaderMutator<T> Provides a mutator for aHeaderproperty.HeaderAccessor.HeaderProperty<T> Provides aHeaderproperty.HeaderRow<T,C extends Column<? extends T>> Record<T> RecordAccessor<T> Provides an accessor for aRecordproperty.RecordAccessor.RecordMutator<T> Provides a mutator for aRecordproperty.RecordAccessor.RecordProperty<T> Provides aRecordproperty.RecordReader<T> Extends theRecordswith functionality for file based implementations regarding header management and means to monitor the state of reading data.Records<T> RecordsAccessor<T> Provides an accessor for aRecordsproperty.RecordsAccessor.RecordsMutator<T> Provides a mutator for aRecordsproperty.RecordsAccessor.RecordsProperty<T> Provides aRecordsproperty.RecordWriter<T> TheRecordWriterwrites data.Row<T> Rows<T> -
Class Summary Class Description AbstractColumn<T> TheAbstractColumnis the default implementation for theColumninterface.AbstractHeader<T,C extends Column<? extends T>> BooleanColumn BooleanColumnFactory Most genericColumnFactoryfor creatingColumninstances managing instances of the (sub-)typeBoolean.CompositeRecords<T> CsvRecordReader<T> TheCsvRecordReaderis an implementation of theRecordReaderinterface and provides functionality to parse CSV input streams:Column<Float> floatColumn = floatColumn( "volume" ); Column<String> stringColumn = floatColumn( "name" ); Column<Integer> intColumn = floatColumn( "length" ); Column<Date> dateColumn = floatColumn( "time" ); try (CsvRecordReader<?CsvRecordWriter<T> TheCsvRecordWriterwrites CSV-Data.CsvStringRecordReader THis implementation of theCsvRecordReaderassumes that for ease of use we just want to handleStringcolumns.CsvStringRecordWriter DateColumn DateColumnimplements theColumnwith support for theDatetype and various default or custom date formats.DoubleColumn DoubleColumnFactory Most genericColumnFactoryfor creatingColumninstances managing instances of the (sub-)typeDouble.EnumColumn<T extends Enum<T>> ExceptionColumn The Class ExceptionColumnImpl.FieldImpl<T> FieldsImpl<T> FloatColumn FloatColumnFactory Most genericColumnFactoryfor creatingColumninstances managing instances of the (sub-)typeFloat.FormattedColumnDecorator<T> Decorator implementation of the HeaderSetupMetrics interface.FormattedColumnImpl<T> Implementation of theFormattedColumninterface.FormattedHeader<T> A list ofColumninstances, for example describing the elements of a CSV file (visually speaking the of the CSV file's header line), is represented by theFormattedHeader.HeaderImpl<T> IntColumn IntColumnFactory Most genericColumnFactoryfor creatingColumninstances managing instances of the (sub-)typeInteger.LongColumn LongColumnFactory ObjectColumn<T> ObjectColumnFactory Most genericColumnFactoryfor creatingColumninstances managing instances of the (sub-)typeObject.RecordImpl<T> RecordsImpl<T> RowImpl<T> RowsImpl<T> StringColumn StringColumnFactory Most genericColumnFactoryfor creatingColumninstances managing instances of the (sub-)typeString.StringHeader StringsColumn TabularSugar Declarative syntactic sugar which may be statically imported in order to allow declarative definitions for the tabular package's elements, e.g. for creatingHeaderorColumninstances orCsvRecordReader(CsvStringRecordReader) orCsvRecordWriter(CsvStringRecordWriter) instances.TabularUtility Utility for listing specific functionality. -
Enum Summary Enum Description PrintStackTrace The Enum PrintStackTrace. -
Exception Summary Exception Description ColumnMismatchException HeaderMismatchException TabularException Base exception for the refcodes-tabular artifact.TabularRuntimeException Base runtime exception for the refcodes-tabular artifact.