NASA World Wind

gov.nasa.worldwind.util
Interface DecisionTree.Controller<T,C>

Type Parameters:
T - the data type of objects associated with tree nodes -- the objects implicitly contained in the tree.
C - the traversal context type.
Enclosing class:
DecisionTree<T,C>

public static interface DecisionTree.Controller<T,C>

Interface defined by the class user to control traversal.


Method Summary
 boolean isTerminal(T o, C context)
          Indicates whether traversal should contine or end at a node.
 boolean isVisible(T o, C context)
          Indicates whether a node is active during traversal.
 T[] split(T o, C context)
          Create a cell's descendant nodes.
 

Method Detail

isTerminal

boolean isTerminal(T o,
                   C context)
Indicates whether traversal should contine or end at a node.

Parameters:
o - the user-defined object specified at traversal start and examined at each tree nodes.
context - the traversal context.
Returns:
true if the node is terminal, otherwise false. Traversal continues to descendants if false is returned. otherwise traversal of the node's branch of the tree stops.

isVisible

boolean isVisible(T o,
                  C context)
Indicates whether a node is active during traversal.

Parameters:
o - the user-defined object specified at traversal start and examined at each tree nodes.
context - the traversal context.
Returns:
true if the node is active, otherwise false.

split

T[] split(T o,
          C context)
Create a cell's descendant nodes. Called in order to continue traversal down a branch of the tree from the current node. The returned nodes are visited in the order returned.

Parameters:
o - the user-defined object specified at traversal start and examined at each tree nodes.
context - the traversal context.
Returns:
an array of descendant nodes.

NASA World Wind