Package ghidra.trace.database.target.visitors

# Enum Class TreeTraversal

java.lang.Object
java.lang.Enum<TreeTraversal>
ghidra.trace.database.target.visitors.TreeTraversal

All Implemented Interfaces:
  `Serializable`, `Comparable<TreeTraversal>`, `Constable`

public enum TreeTraversal extends Enum<TreeTraversal>
Support for traversing a trace's object tree

Many of these are already built into the object and value interfaces. Direct use of this traversal support is only needed when performing customized traversals. In most cases, it's sufficient to use a built-in traversal and filter the resulting stream. Customized traversal is only needed when it's beneficial to prune subtrees in a way that no built-in traversal provides.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `TreeTraversal.SpanIntersectingVisitor`
  A visitor providing default `TreeTraversal.SpanIntersectingVisitor.composeSpan(Lifespan, TraceObjectValue)` that intersects the spans
  `static interface`
  `TreeTraversal.Visitor`
  An object-tree visitor
  `static enum`
  `TreeTraversal.VisitResult`
  A result directing the traversal how to proceed

  ## Nested classes/interfaces inherited from class java.lang.Enum

  `Enum.EnumDesc<E extends Enum<E>>`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `INSTANCE`
  The singleton instance

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static TreeTraversal`
  `valueOf(String name)`
  Returns the enum constant of this class with the specified name.
  `static TreeTraversal[]`
  `values()`
  Returns an array containing the constants of this enum class, in the order they are declared.
  `Stream<? extends TraceObjectValPath>`
  `walkObject(TreeTraversal.Visitor visitor, TraceObject object, Lifespan span, TraceObjectValPath path)`
  Walk an object and its subtree
  `Stream<? extends TraceObjectValPath>`
  `walkValue(TreeTraversal.Visitor visitor, TraceObjectValue value, Lifespan span, TraceObjectValPath path)`
  Walk a value and possibly its subtree

  ### Methods inherited from class java.lang.Enum

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### INSTANCE

    public static final TreeTraversal INSTANCE
    The singleton instance

- ## Method Details

  - ### values

    public static TreeTraversal[] values()
    Returns an array containing the constants of this enum class, in the order they are declared.
    Returns:
      an array containing the constants of this enum class, in the order they are declared

  - ### valueOf

    public static TreeTraversal valueOf(String name)
    Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
    Parameters:
      `name` - the name of the enum constant to be returned.
    Returns:
      the enum constant with the specified name
    Throws:
      `IllegalArgumentException` - if this enum class has no constant with the specified name
      `NullPointerException` - if the argument is null

  - ### walkValue

    public Stream<? extends TraceObjectValPath> walkValue(TreeTraversal.Visitor visitor, TraceObjectValue value, Lifespan span, TraceObjectValPath path)
    Walk a value and possibly its subtree
    Parameters:
      `visitor` - the visitor
      `value` - the current value
      `span` - the composed span from seed to but excluding the current value
      `path` - the path from seed to but excluding the current value
    Returns:
      the result stream of the value and subtree walked

  - ### walkObject

    public Stream<? extends TraceObjectValPath> walkObject(TreeTraversal.Visitor visitor, TraceObject object, Lifespan span, TraceObjectValPath path)
    Walk an object and its subtree
    Parameters:
      `visitor` - the visitor
      `object` - the current object
      `span` - the composed span from seed to current object
      `path` - the path from seed to current object
    Returns:
      the result stream of the object and subtree walked