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 aColumn
property.ColumnAccessor.ColumnMutator<T> Provides a mutator for aColumn
property.ColumnAccessor.ColumnProperty<T> Provides aColumn
property.ColumnFactory<T> AColumnFactory
creates or retrieves aColumn
instances identified by the provided key (name).ColumnRow<T,C extends Column<? extends T>> Columns<T> Field<T> AField
stores an attribute consisting of a key (name) and a value.Fields<T> AFields
stores an attribute consisting of a key (name) and an array of values.FormattedColumn<T> Enriches aColumn
with 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 theFormattedColumn
instances is explicitly required (similar to a DB table or a spread sheet, in contrast to a CSV file) thenFormattedColumn
instances are grouped by aFormattedColumns
set.FormattedHeader<T> A list ofColumn
instances, for example describing the elements of a CSV file (visually speaking the of the CSV file's header line), is represented by theFormattedHeader
.Header<T> HeaderAccessor<T> Provides an accessor for aHeader
property.HeaderAccessor.HeaderBuilder<T extends HeaderAccessor.HeaderBuilder<?>> Provides a mutator for an header property.HeaderAccessor.HeaderMutator<T> Provides a mutator for aHeader
property.HeaderAccessor.HeaderProperty<T> Provides aHeader
property.HeaderRow<T,C extends Column<? extends T>> Record<T> RecordAccessor<T> Provides an accessor for aRecord
property.RecordAccessor.RecordMutator<T> Provides a mutator for aRecord
property.RecordAccessor.RecordProperty<T> Provides aRecord
property.Records<T> RecordsAccessor<T> Provides an accessor for aRecords
property.RecordsAccessor.RecordsMutator<T> Provides a mutator for aRecords
property.RecordsAccessor.RecordsProperty<T> Provides aRecords
property.RecordsReader<T> Extends theRecords
with functionality for file based implementations regarding header management and means to monitor the state of reading data.RecordsWriter<T> TheRecordsWriter
writes data.Row<T> Rows<T> -
Class Summary Class Description AbstractColumn<T> TheAbstractColumn
is the default implementation for theColumn
interface.AbstractHeader<T,C extends Column<? extends T>> Implementation of theHeader
interface beingCloneable
.CompositeRecords<T> CsvRecordsReader<T> TheCsvRecordsReader
is an implementation of theRecords
interface and provides functionality to parse CSV input streams.CsvRecordsWriter<T> TheCsvRecordsWriter
writes CSV-Data.CsvStringRecordsReader THis implementation of theCsvRecordsReader
assumes that for ease of use we just want to handleString
columns.CsvStringRecordsWriter DateColumnImpl DateColumnImpl
implements theColumn
with support for theDate
type and various default or custom date formats.ExceptionColumnImpl The Class ExceptionColumnImpl.FieldImpl<T> Implementation of theField
interface beingCloneable
.FieldsImpl<T> Implementation of theFields
interface beingCloneable
.FormattedColumnDecorator<T> Decorator implementation of the HeaderSetupMetrics interface.FormattedColumnImpl<T> Implementation of theFormattedColumn
interface.FormattedHeaderImpl<T> The Class FormattedHeaderImpl.HeaderImpl<T> Implementation of theHeader
interface beingCloneable
.IntegerColumn IntegerColumnFactory Most genericColumnFactory
for creatingColumn
instances managing instances of the (sub-)typeInteger
.ObjectColumn<T> ObjectColumnFactory Most genericColumnFactory
for creatingColumn
instances managing instances of the (sub-)typeObject
.RecordImpl<T> Implementation of theRecord
interface beingCloneable
.RecordsImpl<T> Implementation of theRecords
interface beingCloneable
.RowImpl<T> Implementation of theRow
interface beingCloneable
.RowsImpl<T> Implementation of theRows
interface beingCloneable
.StringColumn StringColumnFactory Most genericColumnFactory
for creatingColumn
instances managing instances of the (sub-)typeString
.StringsColumn TabularUtility Utility for listing specific functionality. -
Enum Summary Enum Description PrintStackTrace The Enum PrintStackTrace. -
Exception Summary Exception Description ColumnMismatchException HeaderMismatchException Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeader
.TabularException Base exception for the refcodes-tabular artifact.TabularRuntimeException Base runtime exception for the refcodes-tabular artifact.