javax.rad.model.datatype
Class BigDecimalDataType

java.lang.Object
  extended by javax.rad.model.datatype.DataType
      extended by javax.rad.model.datatype.BigDecimalDataType
All Implemented Interfaces:
Serializable, Cloneable, IDataType

public class BigDecimalDataType
extends DataType

A BigDecimalDataType is the data type class for a BigDecimal column. It stores type specific informations like precision and scale.

See Also:
Serialized Form

Field Summary
static int TYPE_IDENTIFIER
          the type identifier.
 
Constructor Summary
BigDecimalDataType()
          Constructs a default BigDecimal data type with undefined precision and scale.
BigDecimalDataType(ICellEditor pCellEditor)
          Constructs a default BigDecimal data type with undefined precision, scale and the given cell editor.
BigDecimalDataType(int pPrecision, int pScale)
          Constructs a default BigDecimal data type with the given precision and scale.
BigDecimalDataType(int pPrecision, int pScale, ICellEditor pCellEditor)
          Constructs a default BigDecimal data type with the given precision, scale and cell editor.
 
Method Summary
 BigDecimalDataType clone()
          Clone an IDataType.
 BigDecimal 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.
 String getNumberFormat()
          Returns the current NumberFormat.
 int getPrecision()
          Returns the precision of the BigDecimalDataType.
 int getScale()
          Returns the scale of the BigDecimalDataType.
 int getSize()
          Returns the size of the DataType.
 Class getTypeClass()
          Returns the class of the Object's handled by IDataType.
 int getTypeIdentifier()
          Gets the data type identifier.
 boolean isSigned()
          Returns if the BigDecimalDataType is signed.
 void setNumberFormat(String pNumberFormat)
          Sets the current NumberFormat.
 void setPrecision(int pPrecision)
          Sets the precision of the BigDecimalDataType.
 void setScale(int pScale)
          Sets the scale of the BigDecimalDataType.
 void setSigned(boolean pSigned)
          Sets if the BigDecimalDataType is signed.
 
Methods inherited from class javax.rad.model.datatype.DataType
compareTo, getCellEditor, getCellRenderer, hashCode, prepareValue, setCellEditor, setCellRenderer, setSize
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_IDENTIFIER

public static final int TYPE_IDENTIFIER
the type identifier.

See Also:
Constant Field Values
Constructor Detail

BigDecimalDataType

public BigDecimalDataType()
Constructs a default BigDecimal data type with undefined precision and scale.


BigDecimalDataType

public BigDecimalDataType(int pPrecision,
                          int pScale)
Constructs a default BigDecimal data type with the given precision and scale.

Parameters:
pPrecision - the precision
pScale - the scale

BigDecimalDataType

public BigDecimalDataType(ICellEditor pCellEditor)
Constructs a default BigDecimal data type with undefined precision, scale and the given cell editor.

Parameters:
pCellEditor - the cell editor

BigDecimalDataType

public BigDecimalDataType(int pPrecision,
                          int pScale,
                          ICellEditor pCellEditor)
Constructs a default BigDecimal data type with the given precision, scale and cell editor.

Parameters:
pPrecision - the precision
pScale - the scale
pCellEditor - the cell editor
Method Detail

getTypeIdentifier

public int getTypeIdentifier()
Gets the data type identifier.

Returns:
a unique type identifier

getTypeClass

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

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

convertToString

public 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

convertToTypeClass

public 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

public BigDecimal 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

getSize

public int getSize()
Returns the size of the DataType.

Overrides:
getSize in class DataType
Returns:
the size of the DataType.

clone

public BigDecimalDataType clone()
Clone an IDataType.

Specified by:
clone in interface IDataType
Overrides:
clone in class DataType
Returns:
a clone of this IDataType
See Also:
Object.clone()

getPrecision

public int getPrecision()
Returns the precision of the BigDecimalDataType.

Returns:
the precision of the BigDecimalDataType.

setPrecision

public void setPrecision(int pPrecision)
Sets the precision of the BigDecimalDataType. Example:
 number(5,2) means Precision = 5, Scale = 2
 number(5)   means Precision = 5, Scale = 0
 

Parameters:
pPrecision - the precision of the BigDecimalDataType.

getScale

public int getScale()
Returns the scale of the BigDecimalDataType.

Returns:
the scale of the BigDecimalDataType.

setScale

public void setScale(int pScale)
Sets the scale of the BigDecimalDataType. Example:
 number(5,2) means Precision = 5, Scale = 2
 number(5)   means Precision = 5, Scale = 0
 

Parameters:
pScale - the scale of the BigDecimalDataType.

isSigned

public boolean isSigned()
Returns if the BigDecimalDataType is signed.

Returns:
if the BigDecimalDataType is signed.

setSigned

public void setSigned(boolean pSigned)
Sets if the BigDecimalDataType is signed.

Parameters:
pSigned - the signed value of the BigDecimalDataType.

getNumberFormat

public String getNumberFormat()
Returns the current NumberFormat.

Returns:
the current NumberFormat.

setNumberFormat

public void setNumberFormat(String pNumberFormat)
Sets the current NumberFormat.

Parameters:
pNumberFormat - the new NumberFormat.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.