abstract class BaseTypeCompiler extends java.lang.Object implements TypeCompiler
Modifier and Type | Field and Description |
---|---|
private TypeId |
correspondingTypeId |
AVG_OP, BOOLEAN_MAXWIDTH_AS_CHAR, DEFAULT_DECIMAL_PRECISION, DEFAULT_DECIMAL_SCALE, DIVIDE_OP, DOUBLE_MAXWIDTH_AS_CHAR, INT_MAXWIDTH_AS_CHAR, LONGINT_MAXWIDTH_AS_CHAR, MAX_DECIMAL_PRECISION_SCALE, MINUS_OP, MOD_OP, PLUS_OP, REAL_MAXWIDTH_AS_CHAR, SMALLINT_MAXWIDTH_AS_CHAR, SUM_OP, TIMES_OP, TINYINT_MAXWIDTH_AS_CHAR
Constructor and Description |
---|
BaseTypeCompiler() |
Modifier and Type | Method and Description |
---|---|
(package private) java.lang.String |
dataValueMethodName()
Return the method name to get a Derby DataValueDescriptor
object of the correct type and set it to a specific value.
|
void |
generateDataValue(MethodBuilder mb,
int collationType,
LocalField field)
The caller will have pushed a DataValueFactory and value
of that can be converted to the correct type, e.g. int
for a SQL INTEGER.
|
void |
generateNull(MethodBuilder mb,
int collationType)
The caller will have pushed a DataValueFactory and a null or a value
of the correct type (interfaceName()).
|
java.lang.String |
getPrimitiveMethodName()
Get the method name for getting out the corresponding primitive
Java type.
|
protected int |
getStoredFormatIdFromTypeId()
Get the StoredFormatId from the corresponding
TypeId.
|
protected TypeCompiler |
getTypeCompiler(TypeId typeId)
Get the TypeCompiler that corresponds to the given TypeId.
|
protected TypeId |
getTypeId()
Get the TypeId that corresponds to this TypeCompiler.
|
(package private) abstract java.lang.String |
nullMethodName()
Return the method name to get a Derby DataValueDescriptor
object of the correct type set to SQL NULL.
|
(package private) boolean |
numberConvertible(TypeId otherType,
boolean forDataTypeFunction)
Tell whether this numeric type can be converted to the given type.
|
(package private) boolean |
numberStorable(TypeId thisType,
TypeId otherType,
ClassFactory cf)
Tell whether this numeric type can be stored into from the given type.
|
(package private) boolean |
pushCollationForDataValue(int collationType)
Return true if the collationType is to be passed
to the methods generated by generateNull and
generateDataValue.
|
DataTypeDescriptor |
resolveArithmeticOperation(DataTypeDescriptor leftType,
DataTypeDescriptor rightType,
java.lang.String operator)
Type resolution methods on binary operators
|
(package private) void |
setTypeId(TypeId typeId)
Set the TypeCompiler that corresponds to the given TypeId.
|
protected boolean |
userTypeStorable(TypeId thisType,
TypeId otherType,
ClassFactory cf)
Determine whether thisType is storable in otherType due to otherType
being a user type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compatible, convertible, getCastToCharWidth, getCorrespondingPrimitiveTypeName, interfaceName, storable
private TypeId correspondingTypeId
public java.lang.String getPrimitiveMethodName()
getPrimitiveMethodName
in interface TypeCompiler
public DataTypeDescriptor resolveArithmeticOperation(DataTypeDescriptor leftType, DataTypeDescriptor rightType, java.lang.String operator) throws StandardException
TypeCompiler
resolveArithmeticOperation
in interface TypeCompiler
leftType
- The type of the left parameterrightType
- The type of the right parameteroperator
- The name of the operator (e.g. "+").StandardException
- Thrown on errorTypeCompiler.resolveArithmeticOperation(org.apache.derby.iapi.types.DataTypeDescriptor, org.apache.derby.iapi.types.DataTypeDescriptor, java.lang.String)
public void generateNull(MethodBuilder mb, int collationType)
generateNull
in interface TypeCompiler
mb
- The method to put the expression incollationType
- For character DVDs, this will be used to determine
what Collator should be associated with the DVD which in turn will
decide whether to generate CollatorSQLcharDVDs or SQLcharDVDs.TypeCompiler.generateNull(MethodBuilder, int)
public void generateDataValue(MethodBuilder mb, int collationType, LocalField field)
generateDataValue
in interface TypeCompiler
mb
- The method to put the expression incollationType
- For character DVDs, this will be used to determine
what Collator should be associated with the DVD which in turn will
decide whether to generate CollatorSQLcharDVDs or SQLcharDVDs. For
other types of DVDs, this parameter will be ignored.field
- LocalFieldTypeCompiler.generateDataValue(MethodBuilder, int, LocalField)
abstract java.lang.String nullMethodName()
java.lang.String dataValueMethodName()
boolean pushCollationForDataValue(int collationType)
collationType
- Collation type of character values.protected boolean userTypeStorable(TypeId thisType, TypeId otherType, ClassFactory cf)
thisType
- The TypeId of the value to be storedotherType
- The TypeId of the value to be stored inboolean numberConvertible(TypeId otherType, boolean forDataTypeFunction)
otherType
- The TypeId of the other type.forDataTypeFunction
- was this called from a scalarFunction like
CHAR() or DOUBLE()boolean numberStorable(TypeId thisType, TypeId otherType, ClassFactory cf)
thisType
- The TypeId of this typeotherType
- The TypeId of the other type.cf
- A ClassFactoryprotected TypeId getTypeId()
protected TypeCompiler getTypeCompiler(TypeId typeId)
void setTypeId(TypeId typeId)
protected int getStoredFormatIdFromTypeId()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.