borland Packages Class Hierarchy jbcl.dataset Package Index
java.lang.Object +----borland.jbcl.dataset.ColumnList
Constructors Properties MethodsThe 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.
public final Column[] getColumnsArray()Read-only property that returns the array of Column components in the ColumnList.
public final int addColumn(borland.jbcl.dataset.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(borland.jbcl.dataset.StorageDataSet dataSet, borland.jbcl.dataset.Column column)Adds the specified Column and DataSet reference to this component. If the column parameter is null, this method throws a DataSetException of NULL_COLUMN_NAME. If the Column is already in the ColumnList, a DataSetException of DUPLICATE_COLUMN_NAME is thrown.
public final Column hasColumn(java.lang.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.