com.akiban.sql.compiler
Class UserDefinedTypeCompiler

java.lang.Object
  extended by com.akiban.sql.compiler.TypeCompiler
      extended by com.akiban.sql.compiler.UserDefinedTypeCompiler

public class UserDefinedTypeCompiler
extends TypeCompiler


Field Summary
 
Fields inherited from class com.akiban.sql.compiler.TypeCompiler
AVG_OP, BOOLEAN_MAXWIDTH_AS_CHAR, DIV_OP, DIVIDE_OP, DOUBLE_MAXWIDTH_AS_CHAR, INT_MAXWIDTH_AS_CHAR, LONGINT_MAXWIDTH_AS_CHAR, MINUS_OP, MOD_OP, PLUS_OP, REAL_MAXWIDTH_AS_CHAR, SMALLINT_MAXWIDTH_AS_CHAR, SUM_OP, TIMES_OP, TINYINT_MAXWIDTH_AS_CHAR
 
Constructor Summary
protected UserDefinedTypeCompiler(TypeId typeId)
           
 
Method Summary
 boolean compatible(TypeId otherType)
          Determine if this type is compatible to some other type (e.g.
 boolean convertible(TypeId otherType, boolean forDataTypeFunction)
          Right now, casting is not allowed from one user defined type to another.
 int getCastToCharWidth(DataTypeDescriptor dts)
          Return the maximum width for this data type when cast to a char type.
 String getCorrespondingPrimitiveTypeName()
          Get the name of the corresponding Java type.
 String getPrimitiveMethodName()
          Get the method name for getting out the corresponding primitive Java type.
 
Methods inherited from class com.akiban.sql.compiler.TypeCompiler
getStoredFormatIdFromTypeId, getTypeCompiler, getTypeId, numberConvertible, resolveArithmeticOperation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserDefinedTypeCompiler

protected UserDefinedTypeCompiler(TypeId typeId)
Method Detail

convertible

public boolean convertible(TypeId otherType,
                           boolean forDataTypeFunction)
Right now, casting is not allowed from one user defined type to another.

Specified by:
convertible in class TypeCompiler
Parameters:
otherType -
forDataTypeFunction -
Returns:
true if otherType is convertible to this type, else false.
See Also:
TypeCompiler.convertible(com.akiban.sql.types.TypeId, boolean)

compatible

public boolean compatible(TypeId otherType)
Description copied from class: TypeCompiler
Determine if this type is compatible to some other type (e.g. COALESCE(thistype, othertype)).

Specified by:
compatible in class TypeCompiler
Parameters:
otherType - The CompilationType of the other type to compare this type to
Returns:
true if the types are compatible, false if not compatible
See Also:
TypeCompiler.compatible(com.akiban.sql.types.TypeId)

getCorrespondingPrimitiveTypeName

public String getCorrespondingPrimitiveTypeName()
Description copied from class: TypeCompiler
Get the name of the corresponding Java type. For numerics and booleans we will get the corresponding Java primitive type. e Each SQL type has a corresponding Java type. When a SQL value is passed to a Java method, it is translated to its corresponding Java type. For example, a SQL Integer will be mapped to a Java int, but a SQL date will be mapped to a java.sql.Date.

Specified by:
getCorrespondingPrimitiveTypeName in class TypeCompiler
Returns:
The name of the corresponding Java primitive type.
See Also:
TypeCompiler.getCorrespondingPrimitiveTypeName()

getPrimitiveMethodName

public String getPrimitiveMethodName()
Get the method name for getting out the corresponding primitive Java type.

Specified by:
getPrimitiveMethodName in class TypeCompiler
Returns:
String The method call name for getting the corresponding primitive Java type.

getCastToCharWidth

public int getCastToCharWidth(DataTypeDescriptor dts)
Description copied from class: TypeCompiler
Return the maximum width for this data type when cast to a char type.

Specified by:
getCastToCharWidth in class TypeCompiler
Parameters:
dts - The associated DataTypeDescriptor for this TypeId.
Returns:
int The maximum width for this data type when cast to a char type.
See Also:
TypeCompiler.getCastToCharWidth(com.akiban.sql.types.DataTypeDescriptor)


Copyright © 2013 Akiban Technologies, Inc. All rights reserved.