|
JTS Topology Suite version 1.13 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vividsolutions.jts.util.objectgraph.ObjectGraphTraverser
public final class ObjectGraphTraverser
Traverses an object graph, visiting each object, array, and primitive once only. (This effectively turns the object graph into a tree). The object tree is traversed in pre-order, meaning that each object or array is traversed (including the base object and each field) followed by any referenced objects and arrays.
The Visitor pattern is used to abstract out traversal behaviour.
The methods of an ObjectVisitor
object are called
for all the objects and fields in the object graph with object and array values.
Reflection is used to access the fields of objects. Static (class) members are not visited.
An explicit stack is used to allow traversing very deep objects (such as large linked lists).
Constructor Summary | |
---|---|
ObjectGraphTraverser()
Creates a new traverser. |
Method Summary | |
---|---|
void |
traverse(java.lang.Object obj,
ObjectVisitor visitor)
Traverses an object using the given visitor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectGraphTraverser()
Method Detail |
---|
public void traverse(java.lang.Object obj, ObjectVisitor visitor)
ObjectVisitor#visitArray(Field, Object)
method
obj
- the object to traversevisitor
- the object visitor
|
JTS Topology Suite version 1.13 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |