This is an old revision of the document!
TwoDimensionalValueObject (2DVO) is a object that can hold a two dimensional array of ValueObjects. This makes it convenient to store values from a database table. The data is stored in column format with each column being represented by a vector. There are n of these where n is the number of rows. All these are stored in a single vector “values”.
That is, the size of the Vector is the number of rows of the data. That is, the organization is: Vector 'Values' (size()== number of columns) VectorColumn0 [Row0Value, Row1Value, …] (size() = number of rows) VectorColumn1 [Row0Value, Row1Value, …] VectorColumn2 [Row0Value, Row1Value, …] .. getColumnCount() returns values.size() getRowCount() returns values.elementAt(0)).size() The data is square, that is, no column values are missing, no rows are short.
Overall, The core idea of 2DVO is to represent each column as a vector and then store these vectors in a main vector. This structure allows for efficient access to rows and columns.
The folowing code snippet demonstrates how to extract data from a TwoDimensionalValueObject and populate a java.util.ArrayList with the objects in an object called “dataObject”:
