org.eigenbase.reltype
Class RelDataTypeFactoryImpl.JavaType

java.lang.Object
  extended by org.eigenbase.reltype.RelDataTypeImpl
      extended by org.eigenbase.reltype.RelDataTypeFactoryImpl.JavaType
All Implemented Interfaces:
RelDataType, RelDataTypeFamily
Enclosing class:
RelDataTypeFactoryImpl

protected class RelDataTypeFactoryImpl.JavaType
extends RelDataTypeImpl

Type which is based upon a Java class.


Field Summary
private  Charset charset
           
private  Class clazz
           
private  SqlCollation collation
           
private  boolean isNullable
           
 
Fields inherited from class org.eigenbase.reltype.RelDataTypeImpl
digest, fieldList, fields
 
Constructor Summary
RelDataTypeFactoryImpl.JavaType(Class clazz)
           
RelDataTypeFactoryImpl.JavaType(Class clazz, boolean nullable)
           
RelDataTypeFactoryImpl.JavaType(Class clazz, boolean nullable, Charset charset, SqlCollation collation)
           
 
Method Summary
protected  void generateTypeString(StringBuilder sb, boolean withDetail)
          Generates a string representation of this type.
 Charset getCharset()
          Gets this type's character set, or null if this type cannot carry a character set or has no character set defined.
 SqlCollation getCollation()
          Gets this type's collation, or null if this type cannot carry a collation or has no collation defined.
 RelDataType getComponentType()
          Gets the component type if this type is a collection, otherwise null.
 Class getJavaClass()
           
 SqlTypeName getSqlTypeName()
          Gets the SqlTypeName of this type.
 boolean isNullable()
          Queries whether this type allows null values.
 
Methods inherited from class org.eigenbase.reltype.RelDataTypeImpl
computeDigest, equals, getComparability, getFamily, getField, getFieldCount, getFieldList, getFieldOrdinal, getFields, getFullTypeString, getIntervalQualifier, getPrecedenceList, getPrecision, getScale, getSqlIdentifier, hashCode, isStruct, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

clazz

private final Class clazz

isNullable

private boolean isNullable

collation

private SqlCollation collation

charset

private Charset charset
Constructor Detail

RelDataTypeFactoryImpl.JavaType

public RelDataTypeFactoryImpl.JavaType(Class clazz)

RelDataTypeFactoryImpl.JavaType

public RelDataTypeFactoryImpl.JavaType(Class clazz,
                                       boolean nullable)

RelDataTypeFactoryImpl.JavaType

public RelDataTypeFactoryImpl.JavaType(Class clazz,
                                       boolean nullable,
                                       Charset charset,
                                       SqlCollation collation)
Method Detail

getJavaClass

public Class getJavaClass()

isNullable

public boolean isNullable()
Description copied from interface: RelDataType
Queries whether this type allows null values.

Specified by:
isNullable in interface RelDataType
Overrides:
isNullable in class RelDataTypeImpl
Returns:
whether type allows null values

generateTypeString

protected void generateTypeString(StringBuilder sb,
                                  boolean withDetail)
Description copied from class: RelDataTypeImpl
Generates a string representation of this type.

Specified by:
generateTypeString in class RelDataTypeImpl
Parameters:
sb - StringBuffer into which to generate the string
withDetail - when true, all detail information needed to compute a unique digest (and return from getFullTypeString) should be included;

getComponentType

public RelDataType getComponentType()
Description copied from interface: RelDataType
Gets the component type if this type is a collection, otherwise null.

Specified by:
getComponentType in interface RelDataType
Overrides:
getComponentType in class RelDataTypeImpl
Returns:
canonical type descriptor for components

getCharset

public Charset getCharset()
                   throws RuntimeException
Description copied from interface: RelDataType
Gets this type's character set, or null if this type cannot carry a character set or has no character set defined.

Specified by:
getCharset in interface RelDataType
Overrides:
getCharset in class RelDataTypeImpl
Returns:
charset of type
Throws:
RuntimeException

getCollation

public SqlCollation getCollation()
                          throws RuntimeException
Description copied from interface: RelDataType
Gets this type's collation, or null if this type cannot carry a collation or has no collation defined.

Specified by:
getCollation in interface RelDataType
Overrides:
getCollation in class RelDataTypeImpl
Returns:
collation of type
Throws:
RuntimeException

getSqlTypeName

public SqlTypeName getSqlTypeName()
Description copied from interface: RelDataType
Gets the SqlTypeName of this type.

Specified by:
getSqlTypeName in interface RelDataType
Overrides:
getSqlTypeName in class RelDataTypeImpl
Returns:
SqlTypeName, or null if this is not an SQL predefined type