edu.neu.ccs.demeterf.compose
Class CompTraversal

java.lang.Object
  extended by edu.neu.ccs.demeterf.compose.CompTraversal

public class CompTraversal
extends java.lang.Object

Traverses an Object structure using Functors: combined BuilderAugmentor(s) that know what to do. The Constructors take any number of Functors. The first one is treated normally, possibly with a traversal argument. All others get the previous Functor's result as a final traversal argument.

See Compose for an example.


Constructor Summary
CompTraversal(BuilderAugmentor... ba)
          Create a Traversal that goes Everywhere using any number of BuilderAugmentor function objects
CompTraversal(BuilderAugmentor[] ba, Control c)
          Create a Traversal with traversal control using any number of BuilderAugmentor function objects
CompTraversal(Functor... fs)
          Create a Traversal that goes Everywhere using any number of Functors
CompTraversal(Functor[] fs, Control c)
          Create a Traversal with traversal control, using any number of Functors
 
Method Summary
 java.lang.Object[] traverse(java.lang.Object o)
          Do the Traversal...
 java.lang.Object[] traverse(java.lang.Object o, java.lang.Object a)
          Do the Traversal...
<T> T
traverseLast(java.lang.Object o)
          Do the Traversal...
<T> T
traverseLast(java.lang.Object o, java.lang.Object arg)
          Do the Traversal...
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompTraversal

public CompTraversal(Functor... fs)
Create a Traversal that goes Everywhere using any number of Functors


CompTraversal

public CompTraversal(Functor[] fs,
                     Control c)
Create a Traversal with traversal control, using any number of Functors


CompTraversal

public CompTraversal(BuilderAugmentor... ba)
Create a Traversal that goes Everywhere using any number of BuilderAugmentor function objects


CompTraversal

public CompTraversal(BuilderAugmentor[] ba,
                     Control c)
Create a Traversal with traversal control using any number of BuilderAugmentor function objects

Method Detail

traverseLast

public <T> T traverseLast(java.lang.Object o)
Do the Traversal... No arguments, but only return the last result


traverseLast

public <T> T traverseLast(java.lang.Object o,
                          java.lang.Object arg)
Do the Traversal... With an argument, but only return the last result


traverse

public java.lang.Object[] traverse(java.lang.Object o)
Do the Traversal... No arguments, return all the results


traverse

public java.lang.Object[] traverse(java.lang.Object o,
                                   java.lang.Object a)
Do the Traversal... With an argument, return all the results