java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
de.grogra.xl.util.ObjectList
de.grogra.imp2d.Visitor2D
- All Implemented Interfaces:
Visitor,ObjectConsumer,VoidToObjectGenerator,Serializable,Cloneable,Iterable,Collection,List,RandomAccess,SequencedCollection
- Direct Known Subclasses:
PickRayVisitor,PickToolVisitor
- See Also:
-
Field Summary
FieldsFields inherited from class de.grogra.xl.util.ObjectList
elements, size, useEqualsFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the graph state within which the visitor is operating.protected voidinit(GraphState gs, EdgePattern pattern, Matrix3d t) protected final Matrix3dprotected final voidvisitEnter(Path path, boolean node) Informs this visitor about a node or edge in the graph.protected ObjectvisitEnter(Object object, boolean asNode, Path path) protected abstract voidInforms this visitor about the beginning of an instantiation.booleanInforms this visitor that an instantiation has been processed completely.booleanvisitLeave(Object o, Path path, boolean node) Informs this visitor that a node or an edge has been processed completely.Methods inherited from class de.grogra.xl.util.ObjectList
add, add, addAll, addAll, addAll, addIfNotContained, addInOrder, addInOrder, arraycopy, clear, clear, clone, consume, contains, ensureCapacity, equals, evaluateObject, get, hashCode, indexOf, isEmpty, lastIndexOf, peek, pop, push, push, push, remove, remove, removeAt, set, setSize, size, toArray, toArray, trimToSize, valuesMethods inherited from class java.util.AbstractList
addAll, iterator, listIterator, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addFirst, addLast, containsAll, getFirst, getLast, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator
-
Field Details
-
state
-
transformation
-
layer
protected int layer
-
-
Constructor Details
-
Visitor2D
public Visitor2D()
-
-
Method Details
-
init
-
getGraphState
Description copied from interface:VisitorReturns the graph state within which the visitor is operating.- Specified by:
getGraphStatein interfaceVisitor- Returns:
- graph state of visitor
-
pushTransformation
-
popTransformation
-
visitEnter
Description copied from interface:VisitorInforms this visitor about a node or edge in the graph.pathcontains the path from the root up to and including the node or, in case an edge is visited, the edge and its terminal node. Later on,Visitor.visitLeave(java.lang.Object, de.grogra.graph.Path, boolean)will be invoked with the returned value of this invocation,pathandnodeas arguments. If this method returnsVisitor.STOP, the correspondingvisitLeave-method will be invoked immediately after this method, i.e., the visitor does not dive more deeply in the hierarchy. Otherwise, if a node is visited and there are instantiations associated with or edges connected with it (regardless of their direction), their corresponding visitor methods will be invoked inbetween. Likewise, if an edge is visited, its indicent terminal node will be visited next.- Specified by:
visitEnterin interfaceVisitor- Parameters:
path- current pathnode- do we enter a node or an edge?- Returns:
- value to pass to
visitLeave, may beVisitor.STOP
-
visitEnter
-
visitImpl
-
visitLeave
Description copied from interface:VisitorInforms this visitor that a node or an edge has been processed completely. The valueois the return value of the corresponding invocation ofVisitor.visitEnter(de.grogra.graph.Path, boolean). In case of a node and if this invocation returnsfalse, no further edges of the current level of hierarchy will be passed to this visitor, i.e., thevisitLeavemethods for the enclosing edge and node will be invoked immediately. Likewise, in case of an edge and a return valuefalse, no further instantiations or edges of the current level of hierarchy will be passed to this visitor, i.e., thevisitLeavemethod for the enclosing node will be invoked immediately.- Specified by:
visitLeavein interfaceVisitor- Parameters:
o- returned value ofvisitEnterpath- current path tonodenode- do we leave a node or an edge?- Returns:
trueiff processing of current level shall be continued
-
visitInstanceEnter
Description copied from interface:VisitorInforms this visitor about the beginning of an instantiation. This method invokation is nested immediately withinvisitEnter/visitLeaveof a node. Later on,Visitor.visitInstanceLeave(Object)will be invoked with the returned value of this invocation as argument. If this method returnsVisitor.STOP, thevisitInstanceLeave-method will be invoked immediately after this method, i.e., the visitor does not dive into the instantiation. Otherwise, the instantiation is performed, starting with an edge.- Specified by:
visitInstanceEnterin interfaceVisitor- Returns:
- value to pass to
visitInstanceLeave, may beVisitor.STOP
-
visitInstanceLeave
Description copied from interface:VisitorInforms this visitor that an instantiation has been processed completely. The valueois the return value of the corresponding invocation ofVisitor.visitInstanceEnter(). If this invocation returnsfalse, no further instantiations or edges of the current level of hierarchy will be passed to this visitor, i.e., thevisitLeavemethod for the enclosing node will be invoked immediately.- Specified by:
visitInstanceLeavein interfaceVisitor- Parameters:
o- returned value ofvisitInstanceEnter- Returns:
trueiff processing of current level shall be continued
-