org.jcae.mesh.oemm
Class TraversalProcedure

java.lang.Object
  extended by org.jcae.mesh.oemm.TraversalProcedure

public abstract class TraversalProcedure
extends java.lang.Object

Abstract class to implement OEMM traversal. Derived classes must define the action(org.jcae.mesh.oemm.OEMM, org.jcae.mesh.oemm.OEMM.Node, int, int) method.

See Also:
OEMM.walk(org.jcae.mesh.oemm.TraversalProcedure)

Field Summary
static int ABORT
          Abort tree traversal immediately.
protected static int LEAF
          Current node is a leaf
static int OK
          Continue tree traversal.
protected static int POSTORDER
          Current node is not a leaf and its children have already been processed.
protected static int PREORDER
          Current node is not a leaf and its children have not been processed yet.
static int SKIPCHILD
          Do not process children.
 
Constructor Summary
TraversalProcedure()
           
 
Method Summary
abstract  int action(OEMM o, OEMM.Node c, int octant, int visit)
          Abstract class which has to be overridden by subclasses.
 void finish(OEMM oemm)
          Method called after traversing the OEMM.
 void init(OEMM oemm)
          Method called before traversing the OEMM.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREORDER

protected static final int PREORDER
Current node is not a leaf and its children have not been processed yet.

See Also:
Constant Field Values

POSTORDER

protected static final int POSTORDER
Current node is not a leaf and its children have already been processed.

See Also:
Constant Field Values

LEAF

protected static final int LEAF
Current node is a leaf

See Also:
Constant Field Values

OK

public static final int OK
Continue tree traversal.

See Also:
Constant Field Values

ABORT

public static final int ABORT
Abort tree traversal immediately.

See Also:
Constant Field Values

SKIPCHILD

public static final int SKIPCHILD
Do not process children.

See Also:
Constant Field Values
Constructor Detail

TraversalProcedure

public TraversalProcedure()
Method Detail

init

public void init(OEMM oemm)
Method called before traversing the OEMM.


finish

public void finish(OEMM oemm)
Method called after traversing the OEMM.


action

public abstract int action(OEMM o,
                           OEMM.Node c,
                           int octant,
                           int visit)
Abstract class which has to be overridden by subclasses.

Parameters:
o - OEMM structure
c - the current node of the OEMM structure
octant - the octant number in parent node
visit - this parameter is set to LEAF if the current node is a leaf, PREORDER if children have not yet been traversed, and POSTOREDER otherwise.
Returns:
ABORT exit from OEMM.walk(org.jcae.mesh.oemm.TraversalProcedure) immediately SKIPCHILD skip current cell (ie do not process its children) OK process normally
See Also:
OEMM.walk(org.jcae.mesh.oemm.TraversalProcedure)