org.apache.ws.jaxme.sqls.impl

Class AbstractColumn

Implemented Interfaces:
BinaryColumn, Column, StringColumn
Known Direct Subclasses:
ColumnImpl, VirtualColumn

public abstract class AbstractColumn
extends java.lang.Object
implements Column, StringColumn, BinaryColumn

Author:
Jochen Wiedmann

Constructor Summary

AbstractColumn(Column.Name pName, Column.Type pType)

Method Summary

boolean
equals(Object o)
Object
getCustomData()
Allows the user to retrieve application specific data, which has previously been attached to the column.
Long
getLength()
If the column has fixed length: Returns the columns length.
Column.Name
getName()
Returns the columns name.
Column.Type
getType()
Returns the columns type.
boolean
hasFixedLength()
Returns whether the column has fixed or variable length.
int
hashCode()
boolean
isBinaryColumn()
Returns whether this Column may be casted to a BinaryColumn.
boolean
isNullable()
Returns whether the column is nullable.
boolean
isStringColumn()
Returns whether this Column may be casted to a StringColumn.
void
setCustomData(Object pCustomData)
Allows the user to attach application specific data to the column.
void
setLength(Long pLength)
If the column has fixed length: Sets the columns length.
void
setLength(long pLength)
Shortcut for setLength(new Integer(pLength)).
void
setNullable(boolean pNullable)
Sets whether the column is nullable.

Constructor Details

AbstractColumn

protected AbstractColumn(Column.Name pName,
                         Column.Type pType)

Method Details

equals

public boolean equals(Object o)

getCustomData

public Object getCustomData()
Allows the user to retrieve application specific data, which has previously been attached to the column.
Specified by:
getCustomData in interface Column

getLength

public Long getLength()
If the column has fixed length: Returns the columns length. Otherwise returns the columns maximum length.
Specified by:
getLength in interface StringColumn
getLength in interface BinaryColumn

getName

public Column.Name getName()
Returns the columns name.
Specified by:
getName in interface Column

getType

public Column.Type getType()
Returns the columns type.
Specified by:
getType in interface Column

hasFixedLength

public boolean hasFixedLength()
Returns whether the column has fixed or variable length.
Specified by:
hasFixedLength in interface StringColumn
hasFixedLength in interface BinaryColumn

hashCode

public int hashCode()

isBinaryColumn

public boolean isBinaryColumn()
Specified by:
isBinaryColumn in interface Column

isNullable

public boolean isNullable()
Returns whether the column is nullable. By default columns are not nullable.
Specified by:
isNullable in interface Column

isStringColumn

public boolean isStringColumn()
Specified by:
isStringColumn in interface Column

setCustomData

public void setCustomData(Object pCustomData)
Allows the user to attach application specific data to the column.
Specified by:
setCustomData in interface Column

setLength

public void setLength(Long pLength)
If the column has fixed length: Sets the columns length. Otherwise sets the columns maximum length.
Specified by:
setLength in interface StringColumn
setLength in interface BinaryColumn

setLength

public void setLength(long pLength)
Shortcut for setLength(new Integer(pLength)).
Specified by:
setLength in interface StringColumn
setLength in interface BinaryColumn

setNullable

public void setNullable(boolean pNullable)
Sets whether the column is nullable. By default columns are not nullable.
Specified by:
setNullable in interface Column