|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sfm.ap210.jsdai.utils.SdaiModelTraverser
public class SdaiModelTraverser
This is a utility class used to control a generic traversal of an SDAI model instance starting from a root entity instance and finding/marking all connected instances. The class can be subclassed to customize the exact traversal conditions.
| Field Summary | |
|---|---|
protected java.util.Set<jsdai.lang.EEntity> |
cuts
|
java.util.Set<jsdai.lang.EEntity> |
marked
|
protected jsdai.lang.SdaiModel |
model
|
protected java.util.List<jsdai.lang.EEntity> |
path
|
protected java.util.Map<jsdai.lang.EEntity,java.util.List<jsdai.lang.EEntity>> |
paths
|
protected jsdai.lang.EEntity |
root
|
java.util.Set<jsdai.lang.EEntity> |
visited
|
| Constructor Summary | |
|---|---|
SdaiModelTraverser(jsdai.lang.SdaiModel model,
jsdai.lang.EEntity root)
Create a new model traversal of the given model instance starting at the given root entity |
|
| Method Summary | |
|---|---|
protected boolean |
checkBackward(jsdai.lang.EEntity ent)
Extension method to allow subclasses to customize the traversal. |
protected boolean |
checkForward(jsdai.lang.EEntity ent)
Extension method to allow subclasses to customize the traversal. |
protected void |
findCuts()
Find/record all cut-entity instances specified by this traversal class |
protected void |
markAndSweep(jsdai.lang.EEntity ent)
Mark the given entity (if applicable) and traverse all forward and backward references of the entity (if applicable) |
void |
printDiscoveryPaths()
Print the path of discovery of each marked entity. |
void |
traverse()
Traverse and mark all covered entities in the model |
protected void |
traverseBackwardRefs(jsdai.lang.EEntity ent)
Traverse all entities directly referencing the given entity |
protected void |
traverseForwardRefs(jsdai.lang.EEntity ent)
Traverse all entities directly referenced by the given entity |
protected void |
updateCuts(jsdai.lang.EEntity ent)
Update cut-nodes for the given entity. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected jsdai.lang.SdaiModel model
protected jsdai.lang.EEntity root
protected java.util.Set<jsdai.lang.EEntity> cuts
protected java.util.List<jsdai.lang.EEntity> path
protected java.util.Map<jsdai.lang.EEntity,java.util.List<jsdai.lang.EEntity>> paths
public java.util.Set<jsdai.lang.EEntity> visited
public java.util.Set<jsdai.lang.EEntity> marked
| Constructor Detail |
|---|
public SdaiModelTraverser(jsdai.lang.SdaiModel model,
jsdai.lang.EEntity root)
throws jsdai.lang.SdaiException
model - the model instanceroot - the root entity to start the traversal
jsdai.lang.SdaiException| Method Detail |
|---|
protected void findCuts()
throws jsdai.lang.SdaiException
jsdai.lang.SdaiException
public void traverse()
throws jsdai.lang.SdaiException
jsdai.lang.SdaiException
protected void markAndSweep(jsdai.lang.EEntity ent)
throws jsdai.lang.SdaiException
ent -
jsdai.lang.SdaiException
protected void traverseBackwardRefs(jsdai.lang.EEntity ent)
throws jsdai.lang.SdaiException
ent -
jsdai.lang.SdaiException
protected void traverseForwardRefs(jsdai.lang.EEntity ent)
throws jsdai.lang.SdaiException
ent -
jsdai.lang.SdaiException
public void printDiscoveryPaths()
throws jsdai.lang.SdaiException
jsdai.lang.SdaiException
protected void updateCuts(jsdai.lang.EEntity ent)
throws jsdai.lang.SdaiException
ent -
jsdai.lang.SdaiException
protected boolean checkForward(jsdai.lang.EEntity ent)
throws jsdai.lang.SdaiException
ent -
jsdai.lang.SdaiException
protected boolean checkBackward(jsdai.lang.EEntity ent)
throws jsdai.lang.SdaiException
ent -
jsdai.lang.SdaiException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||