borland Packages Class Hierarchy dx.dataset Package
java.lang.Object +----com.borland.dx.dataset.ColumnList
Constructors Properties Methods
The ColumnList
component contains a high speed database column name lookup mechanism.
In this system, Column
names are cached as immutable Java
String "references". Once a reference is added to the cache, the
value that the reference points to can never change. This is because it
is immutable and because memory in the Java environment is only freed when
no active objects are referencing it (Java uses a garbage collection memory
management scheme).
In such an environment, the process of looking up a name can be sped up dramatically by caching the reference. Once a String name is cached, future lookups can be performed by very efficient String object reference comparisons. No comparison of the String value is necessary once the String has been added to the cache.
If a String name is not found in the reference cache, a (more expensive) hash lookup by value is performed. Once found, the String name is added to the reference cache.
The reference cache is "least recently allocated". This means that the least recently allocated entry is reused when a new item needs to be added. The cache is not stored as an array of entries because inline compares of cache values is much faster (String arrays are range checked and have the overhead of array subscripting).
public ColumnList()Creates a
ColumnList
component. On error this constructor throws a DataSetException
.
public ColumnList(StorageDataSet dataSet)Creates a
ColumnList
component using the columns in the specified StorageDataSet
. On error this constructor throws a DataSetException
.
public ColumnList(int size)Creates a
ColumnList
component using the specified number of entries. On error this constructor throws a DataSetException
.
public final Column[] getColumnsArray()Read-only property that returns the array of
Column
components in the ColumnList
.
public final int addColumn(Column column)Adds the specified
Column
to this component. If the column
parameter is null, this method throws a DataSetException
of NULL_COLUMN_NAME
.
public final int addColumn(StorageDataSet dataSet, Column column, boolean isUnique, boolean setOrdinals)Adds the specified
Column
in the specified DataSet
to this component. If the column
parameter is null, this method throws a DataSetException
of NULL_COLUMN_NAME
.
isUnique
is a constraint on column values. setOrdinals
is a boolean value which sets the index into the array of Column
s.
public final Column[] cloneColumns()Returns an array of columns which are a copy of the
ColumnList
.
public final int findOrdinal(String columnName)Returns the ordinal of the column specified in
columnName
.
public final Column getColumn(String columnName)Returns the
Column
component given its columnName
. On error, this method throws a DataSetException
.
public final Column hasColumn(String columnName)Checks to see if the specified
columnName
is in the ColumnList
. If the columnName
parameter isn't specified or the columnName
isn't in the ColumnList
, this method returns null. If it is in the ColumnList
, this method returns the Column
component.