Skip navigation links

Package etomica.data.types

Defines classes that encapsulate various types of data and enable casting between them.

See: Description

Package etomica.data.types Description

Defines classes that encapsulate various types of data and enable casting between them. The encapsulating classes are subclasses of Data, which is the abstract type that is transmitted from a DataSource to a DataSink through a data processing stream, via the classes defined in the etomica.data package.

The data held by a Data instance can be changed, and in this sense a Data object is mutable. However, the structure of a Data object is immutable; it cannot be changed after construction. The structure refers to the type and number of data values held by the Data object. Simple Data objects, such as DataDouble and DataInteger, hold a single data value, and have a trivial structure. In contrast, a DataDouble array holds an array of double values; moreover this object can be configured to look like a multidimensional array. Its structure then refers to the shape of this array -- the number of double values it holds, and in what arrangement. It is this aspect of the DataDoubleArray that cannot be changed after construction.

In addition to the data values, a Data object also holds a DataInfo instance, which holds descriptive information about the encapsulated data. The DataInfo held by a Data instance is completely immutable -- the DataInfo instance cannot be changed, nor can the information it holds.

This package defines classes for casting between Data types. These classes normally are constructed by the getDataCaster method of a DataSink, which is invoked by a DataPipe (or similar class) when the DataSink is added to it. The caster is a DataProcessor that will copy the data (as completely as possible) to a new Data instance of the output Data type. This ensures that the DataSink receives a Data instance of the type it is expecting.

Skip navigation links