edu.ksu.cis.projects.bogor.module.value
Interface IExtValue

All Superinterfaces:
Comparable<IValue>, Disposable, IValue, Serializable
All Known Subinterfaces:
IComparablePrimitiveExtValue, INonPrimitiveExtValue, IPrimitiveExtValue

public interface IExtValue
extends IValue

Interface to define methods shared in common between primitive and nonprimitive extension values.

Author:
Matt Hoosier

Method Summary
 void visit(IValueComparator vc, boolean depthFirst, Set<IValue> seen, LinkedList<IValue> workList, IValueVisitorAction vva)
           Visits this value and all reachable values from this value.
 
Methods inherited from interface edu.ksu.cis.projects.bogor.module.value.IValue
clone, equals, getType, getTypeId, hashCode, toString, validate
 
Methods inherited from interface edu.ksu.cis.projects.bogor.util.Disposable
dispose
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

visit

void visit(IValueComparator vc,
           boolean depthFirst,
           Set<IValue> seen,
           LinkedList<IValue> workList,
           IValueVisitorAction vva)

Visits this value and all reachable values from this value. Normally this is best accomplished by first sorting (if applicable) contained values, then adding them to the appropriate end of the workList. For example:

 void visit(
     IValueComparator vc,
     boolean depthFirst,
     Set<IValue> seen,
     LinkedList<IValue> workList,
     IValueVisitorAction vva)
 {
     List<IValue> sortedElements = ... ;
     int size = sortedElements.size();
     
     if (depthFirst)
     {
         for (ListIterator<IValue> iter = elements.listIterator(size); iter
             .hasPrevious();)
         {
             workList.addFirst(iter.previous());
         }
     }
     else
     {
         for (Iterator<IValue> iter = elements.iterator(); iter.hasNext();)
         {
             workList.add(iter.next());
         }
     }
 }
 

Parameters:
vc - The value comparator used to determine which child should be visited first.
depthFirst - Indicates whether the visitor algorithm uses a DFS approach (or BFS).
seen - The seen before value set. Must be non-null.
workList - The work list of the visitor algorithm. Must be non-null.
vva - The action interface used when a value is found. Must be non-null.