|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openjava.mop.OJClass | +--openjava.ptree.util.SyntheticClass
A SyntheticClass
is a class declaration
for
intermediate results in saffron 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: ClassMap.createProject(OJClass, OJClass[], String[])
creates the type of a
select clause, and ClassMap.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 class openjava.mop.OJClass |
|
Fields inherited from interface openjava.mop.OJMember |
DECLARED, PUBLIC |
Constructor Summary | |
(package private) |
SyntheticClass(Environment env,
OJClass declarer,
OJClass[] classes,
String[] fieldNames,
ClassDeclaration decl,
String description)
Called only from ClassMap methods. |
Method Summary | |
static void |
addMembers(ClassDeclaration outerClassDecl,
OJClass[] classes)
Add 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()
Converts the object to a string. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
String description
OJClass[] classes
ClassDeclaration decl
public static final String JOIN_CLASS_PREFIX
public static final String PROJECT_CLASS_PREFIX
public static final String FIELD_PREFIX
Constructor Detail |
SyntheticClass(Environment env, OJClass declarer, OJClass[] classes, String[] fieldNames, ClassDeclaration decl, String description)
ClassMap
methods.
Method Detail |
public String toString()
OJClass
getName
. If this OJClass
object
represents a primitive type, this method returns the name of the
primitive type. If this OJClass
object represents
void this method returns "void".
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 |