|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object openjava.mop.OJClass org.eigenbase.oj.util.OJSyntheticClass
public class OJSyntheticClass
An OJSyntheticClass
is a class declaration
for
intermediate results in expressions. It is created implicitly while
expressions are being compiled.
Two synthetic classes are identical if their attributes are of the same number, type, and order.
Synthetic classes are created in two ways: OJClassMap.createProject(OJClass, OJClass[], String[])
creates the type of a
select clause, and OJClassMap.createJoin(OJClass, OJClass[])
creates
the type of a join. The semantics are slightly different: projection classes
have field names, but join classes do not; two join classes with the same
member types are equivalent, but two distinct projection classes may have the
same set of attributes.
Field Summary | |
---|---|
(package private) OJClass[] |
classes
|
(package private) ClassDeclaration |
decl
|
(package private) String |
description
|
static String |
FIELD_PREFIX
|
static String |
JOIN_CLASS_PREFIX
|
static String |
PROJECT_CLASS_PREFIX
|
Fields inherited from interface openjava.mop.OJMember |
---|
DECLARED, PUBLIC |
Constructor Summary | |
---|---|
OJSyntheticClass(Environment env,
OJClass declarer,
OJClass[] classes,
String[] fieldNames,
ClassDeclaration decl,
String description,
boolean defineValueConstructor)
Called only from OJClassMap methods. |
Method Summary | |
---|---|
static void |
addMembers(ClassDeclaration outerClassDecl,
OJClass[] classes)
Adds declarations of a set of classes classes as inner
classes of a class declaration outerClassDecl . |
static void |
addMethod(ClassDeclaration classDecl,
StatementList statementList,
String name,
String[] parameterNames,
OJClass[] parameterTypes,
OJClass returnType)
Creates a method in a class. |
boolean |
equals(Object o)
|
static int |
getOrdinal(String fieldName,
boolean fail)
Converts a field name back to an ordinal. |
int |
hashCode()
|
static boolean |
isJoinClass(OJClass clazz)
|
static String |
makeField(int ordinal)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String JOIN_CLASS_PREFIX
public static final String PROJECT_CLASS_PREFIX
public static final String FIELD_PREFIX
String description
OJClass[] classes
ClassDeclaration decl
Constructor Detail |
---|
OJSyntheticClass(Environment env, OJClass declarer, OJClass[] classes, String[] fieldNames, ClassDeclaration decl, String description, boolean defineValueConstructor)
OJClassMap
methods.
Method Detail |
---|
public String toString()
toString
in class OJClass
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public static void addMembers(ClassDeclaration outerClassDecl, OJClass[] classes)
classes
as inner
classes of a class declaration outerClassDecl
. Declarations
which are already present are not added again.
public static void addMethod(ClassDeclaration classDecl, StatementList statementList, String name, String[] parameterNames, OJClass[] parameterTypes, OJClass returnType)
public static int getOrdinal(String fieldName, boolean fail)
getOrdinal("$f2")
returns 2. If fieldName is not valid, throws an
error if "fail" is true, otherwise returns -1.
public static String makeField(int ordinal)
public static boolean isJoinClass(OJClass clazz)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |