DODS 7.6 API

com.lutris.dods.builder.generator.query
Class RDBColumnValue

java.lang.Object
  extended by com.lutris.dods.builder.generator.query.RDBColumn
      extended by com.lutris.dods.builder.generator.query.RDBColumnValue

public class RDBColumnValue
extends RDBColumn

After a Vector of RDBColumn objects is used to construct an instance of QueryBuilder, the QueryBuilder.getNextRow() method is used to return an RDBRow object which contains RDBColumnValue objects representing the column values in the returned row. An instance of RDBColumnValue is returned by the RDBRow.get() method. The value contained in the RDBColumnValue object is extracted using RDBColumnValue.get methods.

Author:
Jay Gunter
See Also:
QueryBuilder

Field Summary
 
Fields inherited from class com.lutris.dods.builder.generator.query.RDBColumn
name, notNull, table
 
Constructor Summary
RDBColumnValue(RDBColumn column, java.lang.Object val)
          The constructor for RDBColumnValue is used only by QueryBuilder, never by the application developer.
 
Method Summary
 java.math.BigDecimal getBigDecimal()
          Retreive column value as a BigDecimal.
 java.lang.Double getDouble()
          Retreive column value as an double.
 double getDouble(boolean nullOk)
          Retreive column value as an double.
 java.lang.Integer getInteger()
          Retreive column value as an int.
 int getInteger(boolean nullOk)
          Retreive column value as an int.
 java.lang.String getString()
          Retreive column value as a String.
 java.lang.Object getValue()
          Return the column value as an Object.
 void setValue(java.lang.Object o)
          Used only by the QueryBuilder.
 
Methods inherited from class com.lutris.dods.builder.generator.query.RDBColumn
equals, getColumnName, getFullColumnName, getTableName, notNull
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RDBColumnValue

public RDBColumnValue(RDBColumn column,
                      java.lang.Object val)
The constructor for RDBColumnValue is used only by QueryBuilder, never by the application developer. return the RDBColumnValue object containing the value for the RDBColumn specified.

Parameters:
column - the column specified by QueryBuilder during row access.
val - the value for the column in the currently accessed row.
See Also:
author Jay Gunter
Method Detail

getValue

public java.lang.Object getValue()
Return the column value as an Object. Rarely used by the application developer (only when the type of the column value is not known.)

Returns:
the column value as an Object whose type can be interrogated.
See Also:
author Jay Gunter

setValue

public void setValue(java.lang.Object o)
Used only by the QueryBuilder. Sets the value for the RDBColumnValue object.

Parameters:
o - the value as an Object author Jay Gunter

getString

public java.lang.String getString()
                           throws ColumnTypeException
Retreive column value as a String.

Returns:
the column value as a String.
Throws:
ColumnTypeException - If the column value is not a String (if the column type is not CHAR, VARCHAR, VARCHAR2, etc.)
See Also:
author Jay Gunter

getInteger

public int getInteger(boolean nullOk)
               throws ColumnTypeException,
                      ColumnNullException
Retreive column value as an int.

Parameters:
nullOk - if false and the column in the row contains a database NULL value, a ColumnNullException is thrown. If true and the column in the row contains a NULL, 0 is returned.
Returns:
the column value as an int.
Throws:
ColumnTypeException - If the column value is not an Integer (if the column type is not INTEGER, LONG, etc.) or if NULL is not an allowed value (nullOk==false.)
ColumnNullException
See Also:
author Jay Gunter

getInteger

public java.lang.Integer getInteger()
                             throws ColumnTypeException
Retreive column value as an int.

Returns:
the column value as an int. If the column value is NULL, 0 is returned.
Throws:
ColumnTypeException - If the column value is not an Integer (if the column type is not INTEGER, LONG, etc.)
See Also:
author Jay Gunter

getDouble

public double getDouble(boolean nullOk)
                 throws ColumnTypeException,
                        ColumnNullException
Retreive column value as an double.

Parameters:
nullOk - if false and the column in the row contains a database NULL value, a ColumnNullException is thrown. If true and the column in the row contains a NULL, 0 is returned.
Returns:
the column value as an double.
Throws:
ColumnTypeException - If the column value is not a Double (if the column type is not FLOAT, DOUBLE, NUMERIC, DECIMAL, etc.) or if NULL is not an allowed value (nullOk==false.)
ColumnNullException
See Also:
author Jay Gunter

getDouble

public java.lang.Double getDouble()
                           throws ColumnTypeException
Retreive column value as an double.

Returns:
the column value as an double. If the column value is NULL, 0 is returned.
Throws:
ColumnTypeException - If the column value is not a Double (if the column type is not FLOAT, DOUBLE, NUMERIC, DECIMAL, etc.)
See Also:
author Jay Gunter

getBigDecimal

public java.math.BigDecimal getBigDecimal()
                                   throws ColumnTypeException
Retreive column value as a BigDecimal.

Returns:
the column value as a BigDecimal. If the column value is NULL, 0 is returned.
Throws:
ColumnTypeException - If the column value is not a BigDecimal (if the column type is not NUMERIC, or DECIMAL.)
See Also:
author Jay Gunter

DODS 7.6 API