|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.neu.ccs.demeter.dj.ObjectGraphSlice
A subgraph of an object graph, rooted at the object graph's root, determined by a strategy.
| Field Summary | |
boolean |
debug
|
protected ObjectGraph |
og
|
protected Object |
root
|
protected Traversal.NodeSet |
startSet
|
protected Traversal |
tg
|
| Constructor Summary | |
ObjectGraphSlice(ObjectGraph o,
Strategy s)
The subgraph of o determined by s. |
|
ObjectGraphSlice(ObjectGraph o,
String s)
The subgraph of o determined by strategy s. |
|
ObjectGraphSlice(ObjectGraph o,
Traversal t)
The subgraph of o determined by t. |
|
ObjectGraphSlice(Object o,
Traversal t)
The subgraph of the object graph rooted at o determined by t. |
|
| Method Summary | |
List |
asList()
A fixed-size List backed by the object graph slice. |
List |
asList(boolean forward)
A fixed-size List backed by the object graph slice. |
boolean |
equals(Object ogs)
Compare the traversals and roots with equals(). |
Object |
fetch()
Return the target object in the object graph slice reachable by following the strategy. |
List |
gather()
Return a list of all target objects in the object graph slice reachable by following the strategy. |
List |
gather(boolean forward)
Return a list of all target objects in the object graph slice reachable by following the strategy. |
ClassGraph |
getClassGraph()
The class graph that the object graph slice is an instance of. |
ObjectGraph |
getObjectGraph()
The object graph that this is a slice of. |
Object |
getRoot()
The root of the object graph slice. |
Strategy |
getStrategy()
The strategy expression that was used to build the traversal. |
Traversal |
getTraversal()
The traversal that determines the slice. |
Object |
traverse(Visitor v)
Visit the object graph slice with v, returning
v.getReturnValue(). |
Object |
traverse(Visitor[] v)
Visit the object graph slice with the visitors in v,
returning v[0].getReturnValue(). |
Object |
traverse(Visitor[] v,
boolean forward)
Visit the object graph slice with the visitors in v, returning v[0].getReturnValue(). |
Object |
traverse(Visitor v,
boolean forward)
Visit the object graph slice with v, returning
v.getReturnValue(). |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Traversal tg
protected ObjectGraph og
protected Object root
protected Traversal.NodeSet startSet
public boolean debug
| Constructor Detail |
public ObjectGraphSlice(ObjectGraph o,
Traversal t)
public ObjectGraphSlice(Object o,
Traversal t)
public ObjectGraphSlice(ObjectGraph o,
Strategy s)
throws TraversalException
public ObjectGraphSlice(ObjectGraph o,
String s)
throws TraversalException
| Method Detail |
public Traversal getTraversal()
public ObjectGraph getObjectGraph()
public Object getRoot()
public ClassGraph getClassGraph()
public Strategy getStrategy()
public boolean equals(Object ogs)
equals in class Objectpublic Object traverse(Visitor v)
v, returning
v.getReturnValue().
public Object traverse(Visitor v,
boolean forward)
v, returning
v.getReturnValue(). Traverse edges in left-to-right
order if forward is true, otherwise traverse in
right-to-left order.
public Object traverse(Visitor[] v)
v,
returning v[0].getReturnValue().
public Object traverse(Visitor[] v,
boolean forward)
forward is true, otherwise traverse in right-to-left
order.
public Object fetch()
throws FetchException
FetchExceptionpublic List gather()
public List gather(boolean forward)
forward is true,
otherwise traverse in right-to-left postfix order.
public List asList()
Arrays.asList(java.lang.Object[]),
but unlike the Vector returned by gather()) is
write-through, i.e. modifying it will modify the underlying object
graph, and vice versa.
public List asList(boolean forward)
forward is true,
the graph is traversed in left-to-right prefix order, otherwise it
is traversed in right-to-left postfix order. Note that this list
(like the List returned by Arrays.asList(java.lang.Object[]), but unlike the
Vector returned by gather()) is write-through,
i.e. modifying it will modify the underlying object graph, and vice
versa.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||