|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.reltype.RelDataTypeFactoryImpl
public abstract class RelDataTypeFactoryImpl
Abstract base for implementations of RelDataTypeFactory
.
Nested Class Summary | |
---|---|
protected class |
RelDataTypeFactoryImpl.JavaType
Type which is based upon a Java class. |
Nested classes/interfaces inherited from interface org.eigenbase.reltype.RelDataTypeFactory |
---|
RelDataTypeFactory.FieldInfo, RelDataTypeFactory.ListFieldInfo |
Field Summary | |
---|---|
private HashMap<RelDataType,RelDataType> |
map
|
Constructor Summary | |
---|---|
protected |
RelDataTypeFactoryImpl()
|
Method Summary | |
---|---|
private static void |
addFields(RelDataType type,
ArrayList<RelDataTypeField> fieldList)
Adds all fields in type to fieldList . |
protected RelDataType |
canonize(RelDataType type)
Registers a type, or returns the existing type if it is already registered. |
private RelDataType |
copyRecordType(RelRecordType type,
boolean ignoreNullable,
boolean nullable)
|
private RelDataType |
copySimpleType(RelDataType type,
boolean nullable)
|
RelDataType |
copyType(RelDataType type)
Duplicates a type, making a deep copy. |
RelDataType |
createArrayType(RelDataType elementType,
long maxCardinality)
Creates an array type. |
RelDataType |
createDecimalProduct(RelDataType type1,
RelDataType type2)
implement RelDataTypeFactory with SQL 2003 compliant behavior. |
RelDataType |
createDecimalQuotient(RelDataType type1,
RelDataType type2)
implement RelDataTypeFactory Let p1, s1 be the precision and scale of the first operand Let p2, s2 be the precision and scale of the second operand Let p, s be the precision and scale of the result, Let d be the number of whole digits in the result Then the result type is a decimal with: d = p1 - s1 + s2 s <= max(6, s1 + p2 + 1) p = d + s p and s are capped at their maximum values |
RelDataType |
createJavaType(Class clazz)
Creates a type which corresponds to a Java class. |
RelDataType |
createJoinType(RelDataType[] types)
Creates a cartesian product type. |
RelDataType |
createStructType(List<RelDataType> typeList,
List<String> fieldNameList)
Creates a type which represents a structured collection of fields, given lists of the names and types of the fields. |
RelDataType |
createStructType(RelDataType[] types,
String[] fieldNames)
Creates a type which represents a structured collection of fields. |
RelDataType |
createStructType(RelDataTypeFactory.FieldInfo fieldInfo)
Creates a type which represents a structured collection of fields, obtaining the field information via a callback. |
RelDataType |
createTypeWithNullability(RelDataType type,
boolean nullable)
Creates a type which is the same as another type but with possibly different nullability. |
private RelDataTypeField[] |
fieldsOf(Class clazz)
|
Charset |
getDefaultCharset()
|
private static RelDataTypeField[] |
getFieldArray(RelDataType[] types)
Returns an array of the fields in an array of types. |
private static RelDataType[] |
getTypeArray(RelDataType[] types)
Returns an array of all atomic types in an array. |
private static void |
getTypeArray(RelDataType[] types,
ArrayList<RelDataType> typeList)
|
static boolean |
isJavaType(RelDataType t)
|
RelDataType |
leastRestrictive(RelDataType[] types)
Returns the most general of a set of types (that is, one type to which they can all be cast), or null if conversion is not possible. |
protected RelDataType |
leastRestrictiveStructuredType(RelDataType[] types)
|
boolean |
useDoubleMultiplication(RelDataType type1,
RelDataType type2)
|
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 |
---|
createMultisetType, createSqlIntervalType, createSqlType, createSqlType, createSqlType, createTypeWithCharsetAndCollation |
Field Detail |
---|
private HashMap<RelDataType,RelDataType> map
Constructor Detail |
---|
protected RelDataTypeFactoryImpl()
Method Detail |
---|
public RelDataType createJavaType(Class clazz)
RelDataTypeFactory
createJavaType
in interface RelDataTypeFactory
clazz
- the Java class used to define the type
public RelDataType createJoinType(RelDataType[] types)
RelDataTypeFactory
createJoinType
in interface RelDataTypeFactory
public RelDataType createStructType(RelDataType[] types, String[] fieldNames)
RelDataTypeFactory
createStructType
in interface RelDataTypeFactory
types
- types of the fieldsfieldNames
- names of the fields
public RelDataType createStructType(List<RelDataType> typeList, List<String> fieldNameList)
RelDataTypeFactory
createStructType
in interface RelDataTypeFactory
typeList
- types of the fieldsfieldNameList
- names of the fields
public RelDataType createStructType(RelDataTypeFactory.FieldInfo fieldInfo)
RelDataTypeFactory
createStructType
in interface RelDataTypeFactory
fieldInfo
- callback for field information
public RelDataType leastRestrictive(RelDataType[] types)
RelDataTypeFactory
leastRestrictive
in interface RelDataTypeFactory
types
- input types to be unioned
protected RelDataType leastRestrictiveStructuredType(RelDataType[] types)
private RelDataType copySimpleType(RelDataType type, boolean nullable)
private RelDataType copyRecordType(RelRecordType type, boolean ignoreNullable, boolean nullable)
public RelDataType copyType(RelDataType type)
RelDataTypeFactory
copyType
in interface RelDataTypeFactory
type
- input type
public RelDataType createTypeWithNullability(RelDataType type, boolean nullable)
RelDataTypeFactory
createTypeWithNullability
in interface RelDataTypeFactory
type
- input typenullable
- true to request a nullable type; false to request a NOT
NULL type
protected RelDataType canonize(RelDataType type)
private static RelDataTypeField[] getFieldArray(RelDataType[] types)
private static RelDataType[] getTypeArray(RelDataType[] types)
private static void getTypeArray(RelDataType[] types, ArrayList<RelDataType> typeList)
private static void addFields(RelDataType type, ArrayList<RelDataTypeField> fieldList)
type
to fieldList
.
public static boolean isJavaType(RelDataType t)
private RelDataTypeField[] fieldsOf(Class clazz)
public RelDataType createArrayType(RelDataType elementType, long maxCardinality)
RelDataTypeFactory
createArrayType
in interface RelDataTypeFactory
elementType
- type of the elements of the arraymaxCardinality
- maximum array size, or -1 for unlimited
public RelDataType createDecimalProduct(RelDataType type1, RelDataType type2)
createDecimalProduct
in interface RelDataTypeFactory
type1
- type of the first operandtype2
- type of the second operand
public boolean useDoubleMultiplication(RelDataType type1, RelDataType type2)
useDoubleMultiplication
in interface RelDataTypeFactory
public RelDataType createDecimalQuotient(RelDataType type1, RelDataType type2)
createDecimalQuotient
in interface RelDataTypeFactory
type1
- type of the first operandtype2
- type of the second operand
public Charset getDefaultCharset()
getDefaultCharset
in interface RelDataTypeFactory
Charset
for string types
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |