|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectPptRelation
public class PptRelation
Class that builds and describes relations in the ppt hierachy. Building the relationship is specific to each type of parent/child relationship (eg, method to object, exit to combined exit, etc). The use of the relationship is general. The basic function of the class is to translate from a variable in the parent to the equivalent variable in the child and vice-versa. For example, in the ENTER -> EXIT relationship, the parent is the ENTER ppt and the child is the EXIT ppt. Each variable in the ENTER ppt is connected to the corresponding orig variable in the EXIT ppt.
| Nested Class Summary | |
|---|---|
static class |
PptRelation.PptRelationType
The different ppt/variable hierarchy relationships. |
| Field Summary | |
|---|---|
PptTopLevel |
child
Child of relation. |
Map<VarInfo,VarInfo> |
child_to_parent_map
Map from child vars to matching parent vars. |
static boolean |
dkconfig_enable_object_user
Boolean. |
PptTopLevel |
parent
Parent of relation. |
Map<VarInfo,VarInfo> |
parent_to_child_map
Map from parent vars to matching child vars. |
| Method Summary | |
|---|---|
VarInfo |
childVar(VarInfo parentVar)
Returns the child variable that corresponds to parentVar. |
PptRelation |
copy(PptTopLevel new_parent,
PptTopLevel new_child)
Copies the relation from its current ppts to the specified ppts. |
void |
debug_print_tree(Logger l,
int indent)
Prints a ppt hierarchy of all of the ppts of this child and below. |
Map<VarInfo.Pair,VarInfo.Pair> |
get_child_equalities_as_parent()
Returns a map of VarInfo.Pair with an entry for each pair of equal variables in all of the equality sets of the child. |
PptRelation.PptRelationType |
getRelationType()
Returns a string describing the parent-child relationship. |
boolean |
hasChildren()
Returns whether or not this relation's child has children of its own. |
static void |
init_hierarchy_new(PptMap all_ppts)
Initialize the hierarchical relationship between ppts. |
static void |
init_hierarchy(PptMap all_ppts)
Initialize the hierarchical relationship between ppts. |
boolean |
is_primary()
Returns whether or not this relation is a primary relation. |
static PptRelation |
newClassObjectRel(PptTopLevel parent,
PptTopLevel child)
Returns a relation in the ppt hierarchy from a class (parent) to an object (child) containing static members of that class. |
static PptRelation |
newCombinedExitExitNNRel(PptTopLevel parent,
PptTopLevel child)
Returns a relation in the ppt hierarchy from combined exit points (parent) to an individual exit point (child). |
static PptRelation |
newEnterExitRel(PptTopLevel parent,
PptTopLevel child)
Returns a relation in the ppt hierarchy from enter points to exit points over orig variables. |
static PptRelation |
newMergeChildRel(PptTopLevel parent,
PptTopLevel child)
Returns a an artificial relation in the Program point hierarchy between the same ppt in two different PptMaps. |
static PptRelation |
newObjectMethodRel(PptTopLevel parent,
PptTopLevel child)
Returns a relation in the ppt hierarchy from an object (parent) to a method (child) on that object. |
static PptRelation |
newObjectUserRel(PptTopLevel parent,
PptTopLevel child,
VarInfo arg)
Returns a relation in the ppt hierarchy from an object (parent) to a user (child) of that objects (eg, from the object B to the method A.foo (B arg)) Note that on Nov 22 2005, jhp removed the exception noted below. |
static PptRelation |
newParentRelation(FileIO.ParentRelation pr,
PptTopLevel parent,
PptTopLevel child)
Creates a USER or PARENT relation from child to parent. |
static PptRelation |
newPptPptConditional(PptTopLevel parent,
PptTopLevel child)
Returns a relation in the ppt hierarchy from a ppt to a PptConditional for that point. |
String |
parent_to_child_var_string()
Return a string containing all of the parent->child var relations. |
VarInfo |
parentVar(VarInfo childVar)
Returns the parent variable that corresponds to childVar. |
VarInfo |
parentVarAnyInEquality(VarInfo childVar)
Like parentVar(VarInfo), but if no parent is found, tries every variable in the equality set and returns null only if none of them has a parent. |
boolean |
relate_same_name()
Relates all of the variables with the same name in parent and child. |
int |
size()
Returns the number of parent to child variable relations. |
String |
toString()
|
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public PptTopLevel parent
public PptTopLevel child
public Map<VarInfo,VarInfo> parent_to_child_map
public Map<VarInfo,VarInfo> child_to_parent_map
public static boolean dkconfig_enable_object_user
| Method Detail |
|---|
public int size()
public String toString()
toString in class Objectpublic String parent_to_child_var_string()
public boolean relate_same_name()
public void debug_print_tree(Logger l,
int indent)
public boolean is_primary()
public PptRelation.PptRelationType getRelationType()
public VarInfo parentVar(VarInfo childVar)
public VarInfo parentVarAnyInEquality(VarInfo childVar)
public VarInfo childVar(VarInfo parentVar)
public boolean hasChildren()
public Map<VarInfo.Pair,VarInfo.Pair> get_child_equalities_as_parent()
public static PptRelation newObjectMethodRel(PptTopLevel parent,
PptTopLevel child)
public static PptRelation newClassObjectRel(PptTopLevel parent,
PptTopLevel child)
public static PptRelation newParentRelation(FileIO.ParentRelation pr,
PptTopLevel parent,
PptTopLevel child)
public static PptRelation newObjectUserRel(PptTopLevel parent,
PptTopLevel child,
VarInfo arg)
parent - Ppt of the object definitionchild - Ppt of a user of parent's objectarg - Variable of type object found in child
public static PptRelation newEnterExitRel(PptTopLevel parent,
PptTopLevel child)
public static PptRelation newCombinedExitExitNNRel(PptTopLevel parent,
PptTopLevel child)
public static PptRelation newPptPptConditional(PptTopLevel parent,
PptTopLevel child)
public static PptRelation newMergeChildRel(PptTopLevel parent,
PptTopLevel child)
public PptRelation copy(PptTopLevel new_parent,
PptTopLevel new_child)
public static void init_hierarchy(PptMap all_ppts)
public static void init_hierarchy_new(PptMap all_ppts)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||