|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.iapi.types.DataTypeDescriptor
This is an implementation of DataTypeDescriptor from the generic language datatype module interface.
Field Summary | |
private TypeDescriptorImpl |
typeDescriptor
|
private TypeId |
typeId
|
Fields inherited from interface org.apache.derby.catalog.TypeDescriptor |
MAXIMUM_WIDTH_UNKNOWN |
Constructor Summary | |
DataTypeDescriptor()
Public niladic constructor. |
|
DataTypeDescriptor(DataTypeDescriptor source,
boolean isNullable)
|
|
DataTypeDescriptor(DataTypeDescriptor source,
boolean isNullable,
int maximumWidth)
Constructor for internal uses only |
|
DataTypeDescriptor(DataTypeDescriptor source,
int precision,
int scale,
boolean isNullable,
int maximumWidth)
Constructor for internal uses only. |
|
DataTypeDescriptor(TypeDescriptorImpl source,
TypeId typeId)
Constructor for use in reconstructing a DataTypeDescriptor from a TypeDescriptorImpl and a TypeId |
|
DataTypeDescriptor(TypeId typeId,
boolean isNullable)
|
|
DataTypeDescriptor(TypeId typeId,
boolean isNullable,
int maximumWidth)
Constructor for use with non-numeric types |
|
DataTypeDescriptor(TypeId typeId,
int precision,
int scale,
boolean isNullable,
int maximumWidth)
Constructor for use with numeric types |
Method Summary | |
boolean |
equals(java.lang.Object aTypeDescriptor)
Compare if two TypeDescriptors are exactly the same |
double |
estimatedMemoryUsage()
Get the estimated memory usage for this type descriptor. |
static DataTypeDescriptor |
getBuiltInDataTypeDescriptor(int jdbcType)
Get a descriptor that corresponds to a builtin JDBC type. |
static DataTypeDescriptor |
getBuiltInDataTypeDescriptor(int jdbcType,
boolean isNullable)
Get a descriptor that corresponds to a builtin JDBC type. |
static DataTypeDescriptor |
getBuiltInDataTypeDescriptor(int jdbcType,
boolean isNullable,
int maxLength)
Get a descriptor that corresponds to a builtin JDBC type. |
static DataTypeDescriptor |
getBuiltInDataTypeDescriptor(int jdbcType,
int length)
|
static DataTypeDescriptor |
getBuiltInDataTypeDescriptor(java.lang.String sqlTypeName)
Get a DataTypeServices that corresponds to a builtin SQL type |
static DataTypeDescriptor |
getBuiltInDataTypeDescriptor(java.lang.String sqlTypeName,
int length)
Get a DataTypeServices that corresponds to a builtin SQL type |
TypeDescriptorImpl |
getCatalogType()
Get the simplified type descriptor that is intended to be stored in the system tables. |
DataTypeDescriptor |
getDominantType(DataTypeDescriptor otherDTS,
ClassFactory cf)
Get the dominant type (DataTypeDescriptor) of the 2. |
int |
getJDBCTypeId()
Get the jdbc type id for this type. |
int |
getMaximumWidth()
Returns the maximum width of the type. |
int |
getMaximumWidthInBytes()
Returns the maximum width of the type IN BYTES. |
DataValueDescriptor |
getNull()
Get a Null for this type. |
int |
getPrecision()
Returns the number of decimal digits for the datatype, if applicable. |
int |
getScale()
Returns the number of digits to the right of the decimal for the datatype, if applicable. |
static DataTypeDescriptor |
getSQLDataTypeDescriptor(java.lang.String javaTypeName)
Get a DataTypeServices that corresponds to a Java type |
static DataTypeDescriptor |
getSQLDataTypeDescriptor(java.lang.String javaTypeName,
boolean isNullable)
Get a DataTypeServices that corresponds to a Java type |
static DataTypeDescriptor |
getSQLDataTypeDescriptor(java.lang.String javaTypeName,
int precision,
int scale,
boolean isNullable,
int maximumWidth)
Get a DataTypeDescriptor that corresponds to a Java type |
java.lang.String |
getSQLstring()
Converts this data type descriptor (including length/precision) to a string. |
int |
getTypeFormatId()
Get the formatID which corresponds to this class. |
TypeId |
getTypeId()
Gets the TypeId for the datatype. |
java.lang.String |
getTypeName()
Gets the name of this datatype. |
private static boolean |
isBinaryType(int jdbcType)
|
private static boolean |
isCharacterType(int jdbcType)
|
boolean |
isExactTypeAndLengthMatch(DataTypeDescriptor otherDTS)
Check whether or not the 2 types (DataTypeDescriptor) have the same type and length. |
static boolean |
isJDBCTypeEquivalent(int existingType,
int jdbcTypeId)
Compare JdbcTypeIds to determine if they represent equivalent SQL types. |
boolean |
isNullable()
Returns TRUE if the datatype can contain NULL, FALSE if not. |
static boolean |
isNumericType(int jdbcType)
|
DataValueDescriptor |
normalize(DataValueDescriptor source,
DataValueDescriptor cachedDest)
|
void |
readExternal(java.io.ObjectInput in)
Read this object from a stream of stored objects. |
void |
setNullability(boolean nullable)
Set the nullability of the datatype described by this descriptor |
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput out)
Write this object to a stream of stored objects. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private TypeDescriptorImpl typeDescriptor
private TypeId typeId
Constructor Detail |
public DataTypeDescriptor()
public DataTypeDescriptor(TypeId typeId, int precision, int scale, boolean isNullable, int maximumWidth)
typeId
- The typeId of the type being describedprecision
- The number of decimal digits.scale
- The number of digits after the decimal point.isNullable
- TRUE means it could contain NULL, FALSE means
it definitely cannot contain NULL.maximumWidth
- The maximum number of bytes for this datatypepublic DataTypeDescriptor(TypeId typeId, boolean isNullable, int maximumWidth)
typeId
- The typeId of the type being describedisNullable
- TRUE means it could contain NULL, FALSE means
it definitely cannot contain NULL.maximumWidth
- The maximum number of bytes for this datatypepublic DataTypeDescriptor(TypeId typeId, boolean isNullable)
public DataTypeDescriptor(DataTypeDescriptor source, boolean isNullable)
public DataTypeDescriptor(DataTypeDescriptor source, int precision, int scale, boolean isNullable, int maximumWidth)
source
- The DTSI to copyprecision
- The number of decimal digits.scale
- The number of digits after the decimal point.isNullable
- TRUE means it could contain NULL, FALSE means
it definitely cannot contain NULL.maximumWidth
- The maximum number of bytes for this datatypepublic DataTypeDescriptor(DataTypeDescriptor source, boolean isNullable, int maximumWidth)
source
- The DTSI to copyisNullable
- TRUE means it could contain NULL, FALSE means
it definitely cannot contain NULL.maximumWidth
- The maximum number of bytes for this datatypepublic DataTypeDescriptor(TypeDescriptorImpl source, TypeId typeId)
source
- The TypeDescriptorImpl to construct this DTSI fromMethod Detail |
public static DataTypeDescriptor getBuiltInDataTypeDescriptor(int jdbcType)
jdbcType
- The int type of the JDBC type for which to get
a corresponding SQL DataTypeDescriptor
public static DataTypeDescriptor getBuiltInDataTypeDescriptor(int jdbcType, int length)
public static DataTypeDescriptor getBuiltInDataTypeDescriptor(int jdbcType, boolean isNullable)
jdbcType
- The int type of the JDBC type for which to get
a corresponding SQL DataTypeDescriptorisNullable
- TRUE means it could contain NULL, FALSE means
it definitely cannot contain NULL.
public static DataTypeDescriptor getBuiltInDataTypeDescriptor(int jdbcType, boolean isNullable, int maxLength)
jdbcType
- The int type of the JDBC type for which to get
a corresponding SQL DataTypeDescriptorisNullable
- TRUE means it could contain NULL, FALSE means
it definitely cannot contain NULL.
public static DataTypeDescriptor getBuiltInDataTypeDescriptor(java.lang.String sqlTypeName)
public static DataTypeDescriptor getBuiltInDataTypeDescriptor(java.lang.String sqlTypeName, int length)
public static DataTypeDescriptor getSQLDataTypeDescriptor(java.lang.String javaTypeName)
javaTypeName
- The name of the Java type for which to get
a corresponding SQL DataTypeDescriptor
public static DataTypeDescriptor getSQLDataTypeDescriptor(java.lang.String javaTypeName, boolean isNullable)
javaTypeName
- The name of the Java type for which to get
a corresponding SQL DataTypeDescriptorisNullable
- TRUE means it could contain NULL, FALSE means
it definitely cannot contain NULL.
public static DataTypeDescriptor getSQLDataTypeDescriptor(java.lang.String javaTypeName, int precision, int scale, boolean isNullable, int maximumWidth)
javaTypeName
- The name of the Java type for which to get
a corresponding SQL DataTypeDescriptorprecision
- The number of decimal digitsscale
- The number of digits after the decimal pointisNullable
- TRUE means it could contain NULL, FALSE means
it definitely cannot contain NULL.maximumWidth
- The maximum width of a data value
represented by this type.
public DataValueDescriptor normalize(DataValueDescriptor source, DataValueDescriptor cachedDest) throws StandardException
StandardException
public DataTypeDescriptor getDominantType(DataTypeDescriptor otherDTS, ClassFactory cf) throws StandardException
otherDTS
- DataTypeDescriptor to compare with.cf
- A ClassFactory
StandardException
- Thrown on errorpublic boolean isExactTypeAndLengthMatch(DataTypeDescriptor otherDTS)
otherDTS
- DataTypeDescriptor to compare with.
public int getMaximumWidth()
TypeDescriptor
getMaximumWidth
in interface TypeDescriptor
TypeDescriptor.getMaximumWidth()
public int getMaximumWidthInBytes()
TypeDescriptor
getMaximumWidthInBytes
in interface TypeDescriptor
TypeDescriptor.getMaximumWidthInBytes()
public TypeId getTypeId()
public DataValueDescriptor getNull()
public java.lang.String getTypeName()
getTypeName
in interface TypeDescriptor
public int getJDBCTypeId()
getJDBCTypeId
in interface TypeDescriptor
Types
public int getPrecision()
getPrecision
in interface TypeDescriptor
public int getScale()
getScale
in interface TypeDescriptor
public boolean isNullable()
isNullable
in interface TypeDescriptor
public void setNullability(boolean nullable)
nullable
- TRUE means set nullability to TRUE, FALSE
means set it to FALSE
public boolean equals(java.lang.Object aTypeDescriptor)
public java.lang.String getSQLstring()
getSQLstring
in interface TypeDescriptor
public TypeDescriptorImpl getCatalogType()
public double estimatedMemoryUsage()
public static boolean isJDBCTypeEquivalent(int existingType, int jdbcTypeId)
existingType
- JDBC type id of Cloudscape data type
public static boolean isNumericType(int jdbcType)
private static boolean isCharacterType(int jdbcType)
private static boolean isBinaryType(int jdbcType)
public java.lang.String toString()
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- read this.
java.io.IOException
- thrown on error
java.lang.ClassNotFoundException
- thrown on errorpublic void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- write bytes here.
java.io.IOException
- thrown on errorpublic int getTypeFormatId()
getTypeFormatId
in interface TypedFormat
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |