org.ujac.util.table
Class DefaultColumn

java.lang.Object
  extended by org.ujac.util.table.DefaultColumn
All Implemented Interfaces:
Serializable, Column, TableConstants, UjacTypes
Direct Known Subclasses:
BeanColumn, PrintTableTag.DummyColumn, PrintTableTag.DummyColumn

public class DefaultColumn
extends Object
implements Column, Serializable

Name: DefaultColumn
Description: Default column implementation.

Author:
lauerc
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.ujac.util.table.TableConstants
DEFAULT_DATE_FORMAT, DEFAULT_DOUBLE_FORMAT, DEFAULT_INTEGER_FORMAT, DEFAULT_TIME_FORMAT, DEFAULT_TIMESTAMP_FORMAT, ROW_TYPE_FOOTER, ROW_TYPE_GROUP, ROW_TYPE_GROUP_TITLE, ROW_TYPE_HEADER, ROW_TYPE_NORMAL
 
Fields inherited from interface org.ujac.util.UjacTypes
TYPE_BOOLEAN, TYPE_DATE, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INT, TYPE_LONG, TYPE_NAME_BOOLEAN, TYPE_NAME_DATE, TYPE_NAME_DOUBLE, TYPE_NAME_FLOAT, TYPE_NAME_INT, TYPE_NAME_LONG, TYPE_NAME_OBJECT, TYPE_NAME_SHORT, TYPE_NAME_STRING, TYPE_NAME_TABLE, TYPE_NAME_TIME, TYPE_NAME_TIMESTAMP, TYPE_OBJECT, TYPE_SHORT, TYPE_STRING, TYPE_TABLE, TYPE_TIME, TYPE_TIMESTAMP
 
Constructor Summary
protected DefaultColumn(Table table, String name, boolean key, int type)
          Constructs a DefaultColumn instance with specific arguments.
protected DefaultColumn(Table table, String name, int type)
          Constructs a DefaultColumn instance with specific arguments.
 
Method Summary
 String getAlias()
          Gets the column alias.
 int getDataIndex()
          Gets the data index.
 Format getFormat()
          Gets the colum format.
 int getIndex()
          Gets the colum index.
 LayoutHints getLayoutHints()
          Gets the layout hints.
 String getName()
          Gets the colum name.
 int getType()
          Gets the colum name.
 String getTypeName()
          Gets the name of the column type.
 boolean isKey()
          Tells wheter this column defines a key value or not.
protected  void readData(ObjectInputStream s)
          Reads the object's data from the given stream.
 Column setAlias(String alias)
          Sets the colum alias.
 Column setDataIndex(int dataIndex)
          Sets the data index.
 Column setFormat(Format format)
          Sets the colum format.
 Column setFormat(String format)
          Sets the colum format.
 Column setIndex(int index)
          Sets the colum index.
 Column setKey(boolean key)
          Sets the key flag.
 Column setLayoutHints(LayoutHints layoutHints)
          Sets the layout hints.
protected  void setName(String name)
          Sets the colum name.
 void setType(int type)
          Sets the colum type.
 String toString()
           
protected  void writeData(ObjectOutputStream s)
          Writes the object's data to the given stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultColumn

protected DefaultColumn(Table table,
                        String name,
                        int type)
Constructs a DefaultColumn instance with specific arguments.

Parameters:
table - The column's table.
name - The column name.
type - The column type.

DefaultColumn

protected DefaultColumn(Table table,
                        String name,
                        boolean key,
                        int type)
Constructs a DefaultColumn instance with specific arguments.

Parameters:
table - The column's table.
name - The column name.
key - Tells whether or not the column defines a key value.
type - The column type.
Method Detail

getName

public String getName()
Gets the colum name.

Specified by:
getName in interface Column
Returns:
The column name.

setName

protected void setName(String name)
Sets the colum name.

Parameters:
name - The new column name.

isKey

public boolean isKey()
Tells wheter this column defines a key value or not.

Specified by:
isKey in interface Column
Returns:
true if this column defines a key value, else false.

setKey

public Column setKey(boolean key)
Sets the key flag.

Specified by:
setKey in interface Column
Parameters:
key - The key flag to set.
Returns:
A reference to this instance for more convinience.

getType

public int getType()
Gets the colum name.

Specified by:
getType in interface Column
Returns:
The column type.

setType

public void setType(int type)
Sets the colum type.

Specified by:
setType in interface Column
Parameters:
type - The new column type.

getAlias

public String getAlias()
Gets the column alias.

Specified by:
getAlias in interface Column
Returns:
The column alias.

setAlias

public Column setAlias(String alias)
Sets the colum alias.

Specified by:
setAlias in interface Column
Parameters:
alias - The new column alias.
Returns:
A reference to this instance for more convinience.

getFormat

public Format getFormat()
Gets the colum format.

Specified by:
getFormat in interface Column
Returns:
The column format.

setFormat

public Column setFormat(Format format)
Sets the colum format.

Specified by:
setFormat in interface Column
Parameters:
format - The new column format.
Returns:
A reference to this instance for more convinience.

setFormat

public Column setFormat(String format)
Sets the colum format.

Specified by:
setFormat in interface Column
Parameters:
format - The format string to use.
Returns:
A reference to this instance for more convinience.

getIndex

public int getIndex()
Gets the colum index.

Specified by:
getIndex in interface Column
Returns:
The column index.

setIndex

public Column setIndex(int index)
Sets the colum index.

Specified by:
setIndex in interface Column
Parameters:
index - The new column index.
Returns:
A reference to this instance for more convinience.

getDataIndex

public int getDataIndex()
Gets the data index.

Specified by:
getDataIndex in interface Column
Returns:
The data index.

setDataIndex

public Column setDataIndex(int dataIndex)
Sets the data index.

Specified by:
setDataIndex in interface Column
Parameters:
dataIndex - The new data index.
Returns:
A reference to this instance for more convinience.

getLayoutHints

public LayoutHints getLayoutHints()
Gets the layout hints.

Specified by:
getLayoutHints in interface Column
Returns:
Returns the layout hints.

setLayoutHints

public Column setLayoutHints(LayoutHints layoutHints)
Sets the layout hints.

Specified by:
setLayoutHints in interface Column
Parameters:
layoutHints - The layout hints to set.
Returns:
A reference to this instance for more convinience.

getTypeName

public String getTypeName()
Gets the name of the column type.

Specified by:
getTypeName in interface Column
Returns:
the name of the type or UNKNOWN.

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

writeData

protected void writeData(ObjectOutputStream s)
                  throws IOException
Writes the object's data to the given stream.

Parameters:
s - The stream to write to
Throws:
IOException - In case the data output failed.

readData

protected void readData(ObjectInputStream s)
                 throws IOException,
                        ClassNotFoundException
Reads the object's data from the given stream.

Parameters:
s - The stream to read from.
Throws:
IOException - In case the data reading failed.
ClassNotFoundException - In case the class to deserialize could not be found


Copyright © 2003-2004 UJAC.org. All Rights Reserved.