public abstract class TypeCompiler extends Object
Modifier and Type | Field and Description |
---|---|
static String |
AVG_OP |
static int |
BOOLEAN_MAXWIDTH_AS_CHAR |
static String |
DIV_OP |
static String |
DIVIDE_OP |
static int |
DOUBLE_MAXWIDTH_AS_CHAR |
static int |
INT_MAXWIDTH_AS_CHAR |
static int |
LONGINT_MAXWIDTH_AS_CHAR
Various fixed numbers related to datatypes.
|
static String |
MINUS_OP |
static String |
MOD_OP |
static String |
PLUS_OP |
static int |
REAL_MAXWIDTH_AS_CHAR |
static int |
SMALLINT_MAXWIDTH_AS_CHAR |
static String |
SUM_OP |
static String |
TIMES_OP |
static int |
TINYINT_MAXWIDTH_AS_CHAR |
Modifier | Constructor and Description |
---|---|
protected |
TypeCompiler(TypeId typeId) |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
compatible(TypeId otherType)
Determine if this type is compatible to some other type
(e.g.
|
abstract boolean |
convertible(TypeId otherType,
boolean forDataTypeFunction)
Determine if this type can be CONVERTed to some other type
|
abstract int |
getCastToCharWidth(DataTypeDescriptor dtd)
Return the maximum width for this data type when cast to a char type.
|
abstract String |
getCorrespondingPrimitiveTypeName()
Get the name of the corresponding Java type.
|
abstract String |
getPrimitiveMethodName()
Get the method name for getting out the corresponding primitive
Java type from a DataValueDescriptor.
|
protected int |
getStoredFormatIdFromTypeId()
Get the format id from the corresponding TypeId.
|
static TypeCompiler |
getTypeCompiler(TypeId typeId)
Get the TypeCompiler that corresponds to the given TypeId.
|
TypeId |
getTypeId() |
protected boolean |
numberConvertible(TypeId otherType,
boolean forDataTypeFunction)
Tell whether this numeric type can be converted to the given type.
|
DataTypeDescriptor |
resolveArithmeticOperation(DataTypeDescriptor leftType,
DataTypeDescriptor rightType,
String operator)
Type resolution methods on binary operators
|
public static final int LONGINT_MAXWIDTH_AS_CHAR
public static final int INT_MAXWIDTH_AS_CHAR
public static final int SMALLINT_MAXWIDTH_AS_CHAR
public static final int TINYINT_MAXWIDTH_AS_CHAR
public static final int DOUBLE_MAXWIDTH_AS_CHAR
public static final int REAL_MAXWIDTH_AS_CHAR
public static final int BOOLEAN_MAXWIDTH_AS_CHAR
public static final String PLUS_OP
public static final String DIVIDE_OP
public static final String DIV_OP
public static final String MINUS_OP
public static final String TIMES_OP
public static final String SUM_OP
public static final String AVG_OP
public static final String MOD_OP
protected TypeCompiler(TypeId typeId)
public TypeId getTypeId()
public DataTypeDescriptor resolveArithmeticOperation(DataTypeDescriptor leftType, DataTypeDescriptor rightType, String operator) throws StandardException
leftType
- The type of the left parameterrightType
- The type of the right parameteroperator
- The name of the operator (e.g. "+").StandardException
- Thrown on errorpublic abstract boolean convertible(TypeId otherType, boolean forDataTypeFunction)
otherType
- The CompilationType of the other type to compare
this type toforDataTypeFunction
- true if this is a type function that
requires more liberal behavior (e.g DOUBLE can convert a char but
you cannot cast a CHAR to double.protected boolean numberConvertible(TypeId otherType, boolean forDataTypeFunction)
otherType
- The TypeId of the other type.forDataTypeFunction
- was this called from a scalarFunction like
CHAR() or DOUBLE()public abstract boolean compatible(TypeId otherType)
otherType
- The CompilationType of the other type to compare
this type topublic abstract String getCorrespondingPrimitiveTypeName()
public abstract String getPrimitiveMethodName()
public abstract int getCastToCharWidth(DataTypeDescriptor dtd)
dtd
- The associated DataTypeDescriptor for this TypeId.protected int getStoredFormatIdFromTypeId()
TypeId.FormatIds
public static TypeCompiler getTypeCompiler(TypeId typeId)
Copyright © 2013 Akiban Technologies, Inc. All rights reserved.