public abstract class TypeCompiler
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AVG_OP |
static int |
BOOLEAN_MAXWIDTH_AS_CHAR |
static java.lang.String |
DIV_OP |
static java.lang.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 java.lang.String |
MINUS_OP |
static java.lang.String |
MOD_OP |
static java.lang.String |
PLUS_OP |
static int |
REAL_MAXWIDTH_AS_CHAR |
static int |
SMALLINT_MAXWIDTH_AS_CHAR |
static java.lang.String |
SUM_OP |
static java.lang.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 java.lang.String |
getCorrespondingPrimitiveTypeName()
Get the name of the corresponding Java type.
|
abstract java.lang.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,
java.lang.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 java.lang.String PLUS_OP
public static final java.lang.String DIVIDE_OP
public static final java.lang.String DIV_OP
public static final java.lang.String MINUS_OP
public static final java.lang.String TIMES_OP
public static final java.lang.String SUM_OP
public static final java.lang.String AVG_OP
public static final java.lang.String MOD_OP
protected TypeCompiler(TypeId typeId)
public TypeId getTypeId()
public DataTypeDescriptor resolveArithmeticOperation(DataTypeDescriptor leftType, DataTypeDescriptor rightType, java.lang.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 java.lang.String getCorrespondingPrimitiveTypeName()
public abstract java.lang.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. All Rights Reserved.