org.apache.derby.iapi.types
Class DataTypeUtilities

java.lang.Object
  extended by org.apache.derby.iapi.types.DataTypeUtilities

public abstract class DataTypeUtilities
extends java.lang.Object

A set of static utility methods for data types.


Constructor Summary
DataTypeUtilities()
           
 
Method Summary
static int computeMaxWidth(int precision, int scale)
          Compute the maximum width (column display width) of a decimal or numeric data value, given its precision and scale.
static int getColumnDisplaySize(DataTypeDescriptor dtd)
          Gets the display width of a column of a given type.
static int getColumnDisplaySize(int typeId, int storageLength)
           
static int getDigitPrecision(DataTypeDescriptor dtd)
          Get the precision of the datatype, in decimal digits This is used by EmbedResultSetMetaData.
static int getPrecision(DataTypeDescriptor dtd)
          Get the precision of the datatype.
static boolean isCaseSensitive(DataTypeDescriptor dtd)
          Is the data type case sensitive.
static boolean isCurrency(DataTypeDescriptor dtd)
          Is the data type currency.
static int isNullable(DataTypeDescriptor dtd)
          Is the data type nullable.
static boolean isSigned(DataTypeDescriptor dtd)
          Is the data type signed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataTypeUtilities

public DataTypeUtilities()
Method Detail

getPrecision

public static int getPrecision(DataTypeDescriptor dtd)
Get the precision of the datatype.

Parameters:
dtd - data type descriptor

getDigitPrecision

public static int getDigitPrecision(DataTypeDescriptor dtd)
Get the precision of the datatype, in decimal digits This is used by EmbedResultSetMetaData.

Parameters:
dtd - data type descriptor

isCurrency

public static boolean isCurrency(DataTypeDescriptor dtd)
Is the data type currency.

Parameters:
dtd - data type descriptor

isCaseSensitive

public static boolean isCaseSensitive(DataTypeDescriptor dtd)
Is the data type case sensitive.

Parameters:
dtd - data type descriptor

isNullable

public static int isNullable(DataTypeDescriptor dtd)
Is the data type nullable.

Parameters:
dtd - data type descriptor

isSigned

public static boolean isSigned(DataTypeDescriptor dtd)
Is the data type signed.

Parameters:
dtd - data type descriptor

getColumnDisplaySize

public static int getColumnDisplaySize(DataTypeDescriptor dtd)
Gets the display width of a column of a given type.

Parameters:
dtd - data type descriptor
Returns:
associated column display width

getColumnDisplaySize

public static int getColumnDisplaySize(int typeId,
                                       int storageLength)

computeMaxWidth

public static int computeMaxWidth(int precision,
                                  int scale)
Compute the maximum width (column display width) of a decimal or numeric data value, given its precision and scale.

Parameters:
precision - The precision (number of digits) of the data value.
scale - The number of fractional digits (digits to the right of the decimal point).
Returns:
The maximum number of chracters needed to display the value.

Built on Thu 2010-12-23 20:49:13+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.