javax.rad.model.datatype
Interface IDataType

All Superinterfaces:
Cloneable
All Known Implementing Classes:
BigDecimalDataType, BinaryDataType, BooleanDataType, DataType, ObjectDataType, StringDataType, TimestampDataType

public interface IDataType
extends Cloneable

A IDataType is the data type of the ColumnDefinition. It stores type specific informations like size, precision, ...
On the other hand, it stores the ICellRenderer and ICellEditor. That is because in most cases the GUI control (drawing and editing) depends on the data type.


Method Summary
 IDataType clone()
          Clone an IDataType.
 int compareTo(Object pObject1, Object pObject2)
          Compares IDataType objects in the rules of the Comparable interface.
 Object convertAndCheckToTypeClass(Object pObject)
          Converts the oObject to an Object which is an instance of the class which is handled by IDataType.
 String convertToString(Object pObject)
          Converts the oObject into a String which represents the Object.
 Object convertToTypeClass(Object pObject)
          Converts the oObject to an Object which is an instance of the class which is handled by IDataType.
 ICellEditor getCellEditor()
          Returns the CellEditor for this IDataType.
 ICellRenderer getCellRenderer()
          Returns the CellRenderer for this IDataType.
 Class getTypeClass()
          Returns the class of the Object's handled by IDataType.
 int getTypeIdentifier()
          Gets the data type identifier.
 int hashCode(Object pObject)
          Returns the hash code of the given object or null if the object is null.
 Object prepareValue(Object pObject)
          Prepares the given value.
 void setCellEditor(ICellEditor pCellEditor)
          Sets the CellEditor for this IDataType.
 void setCellRenderer(ICellRenderer pCellRenderer)
          Sets the CellRenderer for this IDataType.
 

Method Detail

getTypeIdentifier

int getTypeIdentifier()
Gets the data type identifier.

Returns:
a unique type identifier

clone

IDataType clone()
Clone an IDataType.

Returns:
a clone of this IDataType
See Also:
Object.clone()

getTypeClass

Class getTypeClass()
Returns the class of the Object's handled by IDataType.

Returns:
the class of the Object's handled by IDataType.

hashCode

int hashCode(Object pObject)
Returns the hash code of the given object or null if the object is null.

Parameters:
pObject - a getTypeClass() object of one IDataType
Returns:
the hash code of the given object or null if the object is null.

compareTo

int compareTo(Object pObject1,
              Object pObject2)
Compares IDataType objects in the rules of the Comparable interface. Implementations need to take care about to null objects are equal.

Parameters:
pObject1 - a getTypeClass() object of one IDataType
pObject2 - a getTypeClass() object of one IDataType
Returns:
-1 if pObject1 is smaller, 0 if equal and +1 if it is greater then pObject2

convertToTypeClass

Object convertToTypeClass(Object pObject)
                          throws ModelException
Converts the oObject to an Object which is an instance of the class which is handled by IDataType.

Parameters:
pObject - the source Object to convert
Returns:
the converted Object that is instance of the class which is handled by IDataType.
Throws:
ModelException - if the class/type of oObject is not supported

convertAndCheckToTypeClass

Object convertAndCheckToTypeClass(Object pObject)
                                  throws ModelException
Converts the oObject to an Object which is an instance of the class which is handled by IDataType. The resulting Object is also checked against the type attributes like size, precision,...

Parameters:
pObject - the source Object to convert
Returns:
the converted Object that is instance of the class which is handled by IDataType.
Throws:
ModelException - if the Object is outside the limits of the DataType attributes

convertToString

String convertToString(Object pObject)
Converts the oObject into a String which represents the Object.

Parameters:
pObject - the source Object to convert
Returns:
the String representation of the source Object

prepareValue

Object prepareValue(Object pObject)
                    throws ModelException
Prepares the given value.

This is used for preparing values for client-side usage and occurs before the client side receives the value for the first time.

If there is nothing to be done, the same object as passed in needs to be returned.

Parameters:
pObject - the object to prepare.
Returns:
the prepared object. If there is nothing to do, the same object.
Throws:
ModelException - if the preparation failed.

setCellEditor

void setCellEditor(ICellEditor pCellEditor)
Sets the CellEditor for this IDataType.

Parameters:
pCellEditor - the new ICellEditor

getCellEditor

ICellEditor getCellEditor()
Returns the CellEditor for this IDataType.

Returns:
the CellEditor for this IDataType.

setCellRenderer

void setCellRenderer(ICellRenderer pCellRenderer)
Sets the CellRenderer for this IDataType.

Parameters:
pCellRenderer - the new ICellRenderer

getCellRenderer

ICellRenderer getCellRenderer()
Returns the CellRenderer for this IDataType.

Returns:
the CellRenderer for this IDataType.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.