Skip navigation links

Package org.refcodes.tabular

The tabular package provides a frame to handle tables of data, often occurring when logging or when working with CSV files.

See: Description

Package org.refcodes.tabular Description

The tabular package provides a frame to handle tables of data, often occurring when logging or when working with CSV files. As of the anatomy of a DB table or spread sheet or a CSV file (or a log file), the table frame provides the base types:

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).

Skip navigation links

Copyright © 2017. All rights reserved.