|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.akiban.sql.compiler.TypeCompiler
public abstract class TypeCompiler
This interface defines methods associated with a TypeId that are used by the compiler.
| Field Summary | |
|---|---|
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
|
| Constructor Summary | |
|---|---|
protected |
TypeCompiler(TypeId typeId)
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
protected TypeCompiler(TypeId typeId)
| Method Detail |
|---|
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 error
public 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 to
public abstract String getCorrespondingPrimitiveTypeName()
public abstract String getPrimitiveMethodName()
public abstract int getCastToCharWidth(DataTypeDescriptor dtd)
dtd - The associated DataTypeDescriptor for this TypeId.
protected int getStoredFormatIdFromTypeId()
TypeId.FormatIdspublic static TypeCompiler getTypeCompiler(TypeId typeId)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||