org.axiondb
Class Column

java.lang.Object
  extended by org.axiondb.Column
All Implemented Interfaces:
Serializable

public class Column
extends Object
implements Serializable

Describes a column within a Table.

Version:
$Revision: 1.27 $ $Date: 2004/09/09 23:47:45 $
See Also:
Serialized Form

Field Summary
static String COLUMN_PRECISION_CONFIG_KEY
          Key for setting and retrieving the Precision in this column's configuration
static String COLUMN_SCALE_CONFIG_KEY
          Key for setting and retrieving the Scale in this column's configuration
static String COLUMN_SQL_TYPE_CONFIG_KEY
          Key for setting and retrieving the sqlType in this column's configuration
static String DATA_TYPE_CONFIG_KEY
          Key for setting and retrieving the DataTypein this column's configuration
static String DEFAULT_VALUE_CONFIG_KEY
          Key for setting and retrieving the default valuein this column's configuration
static String NAME_CONFIG_KEY
          Key for setting and retrieving the name in this column's configuration
 
Constructor Summary
Column(String name, DataType type)
          Create column with the given name and type .
Column(String name, DataType type, Selectable defaultValue)
          Create column with the given name and type .
 
Method Summary
 boolean equals(Object that)
          Two Columns are equal if they have the same name.
 Map getConfiguration()
           
 DataType getDataType()
          Get the DataTypeof this column.
 Selectable getDefault()
           
 String getName()
          Get the name of this column.
 int getScale()
           
 int getSize()
           
 String getSqlType()
           
 boolean hasDefault()
           
 int hashCode()
           
 void setScale(Integer size)
           
 void setSize(Integer size)
           
 void setSqlType(String type)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

COLUMN_PRECISION_CONFIG_KEY

public static final String COLUMN_PRECISION_CONFIG_KEY
Key for setting and retrieving the Precision in this column's configuration

See Also:
Constant Field Values

COLUMN_SCALE_CONFIG_KEY

public static final String COLUMN_SCALE_CONFIG_KEY
Key for setting and retrieving the Scale in this column's configuration

See Also:
Constant Field Values

COLUMN_SQL_TYPE_CONFIG_KEY

public static final String COLUMN_SQL_TYPE_CONFIG_KEY
Key for setting and retrieving the sqlType in this column's configuration

See Also:
Constant Field Values

DATA_TYPE_CONFIG_KEY

public static final String DATA_TYPE_CONFIG_KEY
Key for setting and retrieving the DataTypein this column's configuration

See Also:
Constant Field Values

DEFAULT_VALUE_CONFIG_KEY

public static final String DEFAULT_VALUE_CONFIG_KEY
Key for setting and retrieving the default valuein this column's configuration

See Also:
Constant Field Values

NAME_CONFIG_KEY

public static final String NAME_CONFIG_KEY
Key for setting and retrieving the name in this column's configuration

See Also:
Constant Field Values
Constructor Detail

Column

public Column(String name,
              DataType type)
       throws NullPointerException
Create column with the given name and type .

Parameters:
name - the name of this column, which MUST NOT be null
type - the DataTypeof this column, which MUST NOT be null
Throws:
NullPointerException - if either parameter is null

Column

public Column(String name,
              DataType type,
              Selectable defaultValue)
       throws NullPointerException
Create column with the given name and type .

Parameters:
name - the name of this column, which MUST NOT be null
type - the DataTypeof this column, which MUST NOT be null
config - name-value pairs that configure this column
defaultValue - the default valuefor this column, which may be null
Throws:
NullPointerException - if either name or type is null
Method Detail

equals

public boolean equals(Object that)
Two Columns are equal if they have the same name.

Overrides:
equals in class Object

getConfiguration

public Map getConfiguration()

getDataType

public DataType getDataType()
Get the DataTypeof this column.


getDefault

public Selectable getDefault()

getName

public String getName()
Get the name of this column.


getScale

public int getScale()

getSize

public int getSize()

getSqlType

public String getSqlType()

hasDefault

public boolean hasDefault()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

setScale

public void setScale(Integer size)

setSize

public void setSize(Integer size)

setSqlType

public void setSqlType(String type)

toString

public String toString()
Overrides:
toString in class Object