SilverStream
Application Server 3.5

com.sssw.rt.util
Interface AgiBandDescriptor

All Known Implementing Classes:
AgoVectorRowCursor

public interface AgiBandDescriptor

This interface describes the columns provided by a particular named band for an AgiRowCursor object or an AgiDataSource object.

Implement this interface when writing a custom AgiRowCursor intended to be available for data binding in the SilverStream designer interfaces. An AgiBandDesciptor interface will also need to be implemented when writing a data source that implements the AgiDataSource interface.


Method Summary
 boolean canQueryColumn(int index)
          Return true if the specified column's value can be used in queries.
 String getBandName()
          Get the name of the band.
 int getColumnCount()
          Get the number of columns provided by this band.
 String getColumnName(int index)
          Get the name of the specified column.
 char getColumnType(int index)
          Get the type of the specified column.
 String getPrimaryTableName()
          Return the name of the primary table for this band.
 

Method Detail

getBandName

public String getBandName()
Get the name of the band. If there is only one band, this method can return null, indicating that the data binding mechanism should not check the band name.
Example:
 public String getBandName()
 {
 return null;
 }
 

getPrimaryTableName

public String getPrimaryTableName()
Return the name of the primary table for this band. The primary table is the table that can be updated by changes to the columns in this band. Data binding support does not require this method.
Example:
 public String getPrimaryTableName()
 {
 return "Names";
 }
 

getColumnCount

public int getColumnCount()
Get the number of columns provided by this band.
Example:
 public int getColumnCount()
 {
 return 2;
 }
 

getColumnName

public String getColumnName(int index)
Get the name of the specified column. This should return the fully-qualified column name (tablename.columnname).
Parameters:
index - the index of the column. Column numnbers are zero-based.
Usage:

Column names must begin with a letter and can contain only letters, numbers, and underscores.

Example:
 public String getColumnName(int index)
 {
 if (index == 0)
     return "ID";
 else if (index == 1)
     return "Name";
 else
     throw new IllegalArgumentException();
 }
 

getColumnType

public char getColumnType(int index)
Get the type of the specified column.
Parameters:
index - the column index. Columns numbers are zero-based.
Returns:
a data type constant from DatatypeCodes
Example:
 public Char getColumnType(int index)
 {
 if (index == 0)
     return DatatypeCodes.TYPE_INT;
 else if (index == 1)
     return DatatypeCodes.TYPE_STRING;
 else
     throw new IllegalArgumentException();
 }
 

canQueryColumn

public boolean canQueryColumn(int index)
Return true if the specified column's value can be used in queries.
Parameters:
index - the column index. Columns numbers are zero-based.
Usage:

Certain column types, such as LONGVARCHAR, are not allowed in queries. Data binding support does not require this method.

Example:
 public boolean canQueryColumn(int index)
 {
 if (index == 0)
     return true;
 else if (index == 1)
     return true;
 else
     throw new IllegalArgumentException();
 }
 

SilverStream
Application Server 3.5