org.eigenbase.oj
Class OJTypeFactoryImpl

java.lang.Object
  extended by org.eigenbase.reltype.RelDataTypeFactoryImpl
      extended by org.eigenbase.sql.type.SqlTypeFactoryImpl
          extended by org.eigenbase.oj.OJTypeFactoryImpl
All Implemented Interfaces:
OJTypeFactory, RelDataTypeFactory
Direct Known Subclasses:
FarragoTypeFactoryImpl

public class OJTypeFactoryImpl
extends SqlTypeFactoryImpl
implements OJTypeFactory

Implementation of RelDataTypeFactory based upon OpenJava's type system.

Since:
May 30, 2003
Version:
$Id: //open/dev/farrago/src/org/eigenbase/oj/OJTypeFactoryImpl.java#14 $
Author:
jhyde
See Also:
OJClass, RelDataTypeFactory

Nested Class Summary
private  class OJTypeFactoryImpl.OJScalarType
          Type based upon an OJClass.
 
Nested classes/interfaces inherited from class org.eigenbase.reltype.RelDataTypeFactoryImpl
RelDataTypeFactoryImpl.JavaType
 
Nested classes/interfaces inherited from interface org.eigenbase.reltype.RelDataTypeFactory
RelDataTypeFactory.FieldInfo, RelDataTypeFactory.ListFieldInfo
 
Field Summary
protected  HashMap<OJClass,RelDataType> mapOJClassToType
           
private  OJClassMap ojClassMap
           
 
Constructor Summary
  OJTypeFactoryImpl()
          Creates an OJTypeFactoryImpl.
protected OJTypeFactoryImpl(OJClassMap ojClassMap)
           
 
Method Summary
 RelDataType createArrayType(RelDataType elementType, long maxCardinality)
          Creates an array type.
 RelDataType createJavaType(Class clazz)
          Creates a type which corresponds to a Java class.
protected  OJClass createOJClassForRecordType(OJClass declarer, RelDataType recordType)
           
 OJClass toOJClass(OJClass declarer, RelDataType type)
           
 RelDataType toType(OJClass ojClass)
           
 
Methods inherited from class org.eigenbase.sql.type.SqlTypeFactoryImpl
canonize, createMultisetType, createSqlIntervalType, createSqlType, createSqlType, createSqlType, createTypeWithCharsetAndCollation, createTypeWithNullability, leastRestrictive, shouldRaggedFixedLengthValueUnionBeVariable
 
Methods inherited from class org.eigenbase.reltype.RelDataTypeFactoryImpl
copyType, createDecimalProduct, createDecimalQuotient, createJoinType, createStructType, createStructType, createStructType, getDefaultCharset, isJavaType, leastRestrictiveStructuredType, useDoubleMultiplication
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eigenbase.reltype.RelDataTypeFactory
copyType, createDecimalProduct, createDecimalQuotient, createJoinType, createMultisetType, createSqlIntervalType, createSqlType, createSqlType, createSqlType, createStructType, createStructType, createStructType, createTypeWithCharsetAndCollation, createTypeWithNullability, getDefaultCharset, leastRestrictive, useDoubleMultiplication
 

Field Detail

mapOJClassToType

protected final HashMap<OJClass,RelDataType> mapOJClassToType

ojClassMap

private final OJClassMap ojClassMap
Constructor Detail

OJTypeFactoryImpl

public OJTypeFactoryImpl()
Creates an OJTypeFactoryImpl.


OJTypeFactoryImpl

protected OJTypeFactoryImpl(OJClassMap ojClassMap)
Method Detail

createJavaType

public RelDataType createJavaType(Class clazz)
Description copied from interface: RelDataTypeFactory
Creates a type which corresponds to a Java class.

Specified by:
createJavaType in interface RelDataTypeFactory
Overrides:
createJavaType in class RelDataTypeFactoryImpl
Parameters:
clazz - the Java class used to define the type
Returns:
canonical Java type descriptor

createArrayType

public RelDataType createArrayType(RelDataType elementType,
                                   long maxCardinality)
Description copied from interface: RelDataTypeFactory
Creates an array type. Arrays are ordered collections of elements.

Specified by:
createArrayType in interface RelDataTypeFactory
Overrides:
createArrayType in class RelDataTypeFactoryImpl
Parameters:
elementType - type of the elements of the array
maxCardinality - maximum array size, or -1 for unlimited
Returns:
canonical array type descriptor

createOJClassForRecordType

protected OJClass createOJClassForRecordType(OJClass declarer,
                                             RelDataType recordType)

toOJClass

public OJClass toOJClass(OJClass declarer,
                         RelDataType type)
Specified by:
toOJClass in interface OJTypeFactory

toType

public RelDataType toType(OJClass ojClass)
Specified by:
toType in interface OJTypeFactory