java.io.Externalizable
, java.io.Serializable
, TypeDescriptor
, Formatable
, TypedFormat
public class TypeDescriptorImpl extends java.lang.Object implements TypeDescriptor, Formatable
Modifier and Type | Field | Description |
---|---|---|
private int |
collationType |
|
private boolean |
isNullable |
|
private int |
maximumWidth |
|
private int |
precision |
|
private int |
scale |
|
private BaseTypeIdImpl |
typeId |
This class implements Formatable.
|
DOUBLE, INTEGER, INTEGER_NOT_NULL, MAXIMUM_WIDTH_UNKNOWN, SMALLINT, SMALLINT_NOT_NULL
Constructor | Description |
---|---|
TypeDescriptorImpl() |
Public niladic constructor.
|
TypeDescriptorImpl(BaseTypeIdImpl typeId,
boolean isNullable,
int maximumWidth) |
Constructor for use with non-numeric types
|
TypeDescriptorImpl(BaseTypeIdImpl typeId,
int precision,
int scale,
boolean isNullable,
int maximumWidth) |
Constructor for use with numeric types
|
TypeDescriptorImpl(BaseTypeIdImpl typeId,
int precision,
int scale,
boolean isNullable,
int maximumWidth,
int collationType) |
Constructor to use when the caller doesn't know if it is requesting
numeric or no-numeric DTD.
|
TypeDescriptorImpl(TypeDescriptorImpl source,
boolean isNullable,
int maximumWidth) |
Constructor for internal uses only
|
TypeDescriptorImpl(TypeDescriptorImpl source,
int precision,
int scale,
boolean isNullable,
int maximumWidth) |
Constructor for internal uses only.
|
TypeDescriptorImpl(TypeDescriptorImpl source,
int precision,
int scale,
boolean isNullable,
int maximumWidth,
int collationType) |
Modifier and Type | Method | Description |
---|---|---|
static TypeDescriptor[] |
copyTypeDescriptors(TypeDescriptor[] original) |
copy an array of type descriptors
|
boolean |
equals(java.lang.Object object) |
Compare if two TypeDescriptors are exactly the same
|
int |
getCollationType() |
Get the collation type for this type.
|
int |
getJDBCTypeId() |
Get the jdbc type id for this type.
|
int |
getMaximumWidth() |
Returns the maximum width of the type.
|
int |
getMaximumWidthInBytes() |
Return the length of this type in bytes.
|
int |
getPrecision() |
Returns the number of decimal digits for the datatype, if applicable.
|
java.lang.String[] |
getRowColumnNames() |
If this catalog type is a row multi-set type
then return its array of column names.
|
TypeDescriptor[] |
getRowTypes() |
If this catalog type is a row multi-set type
then return its array of catalog types.
|
int |
getScale() |
Returns the number of digits to the right of the decimal for
the datatype, if applicable.
|
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.
|
BaseTypeIdImpl |
getTypeId() |
Get the type Id stored within this type descriptor.
|
java.lang.String |
getTypeName() |
Gets the name of this datatype.
|
boolean |
isNullable() |
Returns TRUE if the datatype can contain NULL, FALSE if not.
|
boolean |
isRowMultiSet() |
Return true if this is a Row Multiset type
|
boolean |
isStringType() |
Report whether this type is a string type.
|
boolean |
isUserDefinedType() |
Return true if this is a user defined type
|
void |
readExternal(java.io.ObjectInput in) |
Read this object from a stream of stored objects.
|
void |
setCollationType(int collationTypeValue) |
|
java.lang.String |
toString() |
|
void |
writeExternal(java.io.ObjectOutput out) |
Write this object to a stream of stored objects.
|
private BaseTypeIdImpl typeId
private int precision
private int scale
private boolean isNullable
private int maximumWidth
private int collationType
TypeDescriptor.getCollationType()
public TypeDescriptorImpl()
public TypeDescriptorImpl(BaseTypeIdImpl 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 TypeDescriptorImpl(BaseTypeIdImpl typeId, int precision, int scale, boolean isNullable, int maximumWidth, int collationType)
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 datatypecollationType
- The collation type of a string data typepublic TypeDescriptorImpl(BaseTypeIdImpl 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 TypeDescriptorImpl(TypeDescriptorImpl 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 TypeDescriptorImpl(TypeDescriptorImpl source, int precision, int scale, boolean isNullable, int maximumWidth, int collationType)
public TypeDescriptorImpl(TypeDescriptorImpl 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 static TypeDescriptor[] copyTypeDescriptors(TypeDescriptor[] original)
public int getMaximumWidth()
TypeDescriptor
getMaximumWidth
in interface TypeDescriptor
TypeDescriptor.getMaximumWidth()
public int getMaximumWidthInBytes()
getMaximumWidthInBytes
in interface TypeDescriptor
TypeDescriptor.getMaximumWidthInBytes()
public boolean isStringType()
public int getJDBCTypeId()
getJDBCTypeId
in interface TypeDescriptor
Types
public java.lang.String getTypeName()
getTypeName
in interface TypeDescriptor
public int getPrecision()
getPrecision
in interface TypeDescriptor
public int getScale()
getScale
in interface TypeDescriptor
public boolean isNullable()
isNullable
in interface TypeDescriptor
public boolean isRowMultiSet()
TypeDescriptor
isRowMultiSet
in interface TypeDescriptor
TypeDescriptor.isRowMultiSet()
public boolean isUserDefinedType()
TypeDescriptor
isUserDefinedType
in interface TypeDescriptor
TypeDescriptor.isUserDefinedType()
public int getCollationType()
TypeDescriptor
getCollationType
in interface TypeDescriptor
TypeDescriptor.getCollationType()
public void setCollationType(int collationTypeValue)
public java.lang.String getSQLstring()
getSQLstring
in interface TypeDescriptor
public java.lang.String toString()
toString
in class java.lang.Object
public BaseTypeIdImpl getTypeId()
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- the dataTypeDescriptor to compare to.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 errorjava.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
public java.lang.String[] getRowColumnNames()
TypeDescriptor
getRowColumnNames
in interface TypeDescriptor
public TypeDescriptor[] getRowTypes()
TypeDescriptor
getRowTypes
in interface TypeDescriptor
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.