|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--saffron.rel.TypeFactoryImpl
Implementation of TypeFactory
.
Nested Class Summary | |
protected class |
TypeFactoryImpl.CrossType
Type of the cartesian product of two or more sets of records. |
protected static class |
TypeFactoryImpl.FieldImpl
Simple implementation of Field |
protected class |
TypeFactoryImpl.RecordType
Type which is a set of named fields. |
protected class |
TypeFactoryImpl.ScalarType
Type which is based upon a Java class. |
protected class |
TypeFactoryImpl.TypeImpl
Abstract implementation for Type . |
Nested classes inherited from class saffron.rel.TypeFactory |
TypeFactory.FieldInfo |
Field Summary | |
private HashMap |
map
|
private static ThreadLocal |
threadInstances
|
Constructor Summary | |
TypeFactoryImpl()
|
Method Summary | |
private static void |
addFields(Type type,
ArrayList fieldList)
Adds all fields in type to fieldList . |
protected Type |
canonize(Type type)
Registers a type, or returns the existing type if it is already registered. |
Type |
createJavaType(Class clazz)
Creates a type which encapsulates a Java class. |
Type |
createJoinType(Type[] types)
Creates a cartesian product type. |
Type |
createProjectType(Type[] types,
String[] fieldNames)
Creates a type which represents a projection of a set of fields. |
Type |
createProjectType(TypeFactory.FieldInfo fieldInfo)
Creates a type which represents a projection of a set fields, getting the field informatation from a callback. |
private static Field[] |
getFieldArray(Type[] types)
Returns an array of the fields in an array of types. |
private static Type[] |
getTypeArray(Type[] types)
Returns an array of all atomic types in an array. |
private static void |
getTypeArray(Type[] types,
ArrayList typeList)
|
Type |
leastRestrictive(Type[] 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. |
static void |
setThreadInstance(TypeFactory typeFactory)
|
static TypeFactory |
threadInstance()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private HashMap map
private static ThreadLocal threadInstances
Constructor Detail |
public TypeFactoryImpl()
Method Detail |
public Type createProjectType(Type[] types, String[] fieldNames)
TypeFactory
The return is canonical: if an equivalent type already exists, it is returned.
createProjectType
in interface TypeFactory
types
- Types of the fieldsfieldNames
- Names of the fields
public Type createProjectType(TypeFactory.FieldInfo fieldInfo)
TypeFactory
createProjectType
in interface TypeFactory
public Type createJoinType(Type[] types)
TypeFactory
createJoinType
in interface TypeFactory
public Type createJavaType(Class clazz)
TypeFactory
createJavaType
in interface TypeFactory
public Type leastRestrictive(Type[] types)
TypeFactory
leastRestrictive
in interface TypeFactory
protected Type canonize(Type type)
private static Type[] getTypeArray(Type[] types)
private static void getTypeArray(Type[] types, ArrayList typeList)
private static Field[] getFieldArray(Type[] types)
private static void addFields(Type type, ArrayList fieldList)
type
to fieldList
.
public static void setThreadInstance(TypeFactory typeFactory)
public static TypeFactory threadInstance()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |