Walker (BioJava-1.5-beta API)
Keywords: org.biojava.utils.walker.Walker interface

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.biojava.utils.walker
Interface Walker

    public interface Walker

Objects that can walk over a filter expression, showing each element to a visitor.

Walker implementations are not guaranteed to be thread-safe. In particular, it is not possible to use the same Walker instance with more than one thread if the visitor has return values. Walker implementations can be re-used once the previous walk has been completed.

Author:
  Matthew Pocock
For general use:
  You should use FilterUtils.visitFilter to apply a visitor to a feature filter.
For advanced users:
  You can use WalkerFactory.getInstance().getWalker(visitor) to get a walker that is suitable for your visitor implementation. This will take care of all the magic needed to hook up visitor call-back methods to the walkers traversal of the features.
For developers:
  If you don't like the walkers that WalkerFactory produces, you can implement this directly. This will work fine for simple visitors, e.g., which only have a single method for visting all filters, regardless of type.

Method Summary
`Object` | `getValue()` If the visitor has a return value, then the result of applying the visitor to the tree can be obtained using this method, otherwise the result will be null.
`void` | `walk(Object filter, Visitor visitor)` This walks the feature tree, showing the visitor each filter in the expression.

Method Detail

### walk

    void walk(Object filter,
              Visitor visitor)

  This walks the feature tree, showing the visitor each filter in the expression.

  Parameters:
    `filter` -
    `visitor` -

### getValue

    Object getValue()

  If the visitor has a return value, then the result of applying the visitor to the tree can be obtained using this method, otherwise the result will be null.

  Returns:
    the visitor's return value, or null

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD