Package ghidra.trace.database.target

# Class DBTraceObjectValPath

java.lang.Object
ghidra.trace.database.target.DBTraceObjectValPath

All Implemented Interfaces:
  `TraceObjectValPath`, `Comparable<TraceObjectValPath>`

public class DBTraceObjectValPath extends Object implements TraceObjectValPath

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final DBTraceObjectValPath`
  `EMPTY`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DBTraceObjectValPath`
  `append(TraceObjectValue entry)`
  Append the entry to this path, generating a new path
  `int`
  `compareTo(TraceObjectValPath that)`
  `protected KeyPath`
  `computePath()`
  `boolean`
  `contains(TraceObjectValue entry)`
  Check if a given value appears on this path
  `TraceObject`
  `getDestination(TraceObject ifEmpty)`
  Get the destination object
  `Object`
  `getDestinationValue(Object ifEmpty)`
  Get the destination value
  `List<DBTraceObjectValue>`
  `getEntryList()`
  Get the values in the path, ordered from source to destination
  `DBTraceObjectValue`
  `getFirstEntry()`
  Get the first entry, i.e., the one adjacent to the source object
  `DBTraceObjectValue`
  `getLastEntry()`
  Get the last entry, i.e., the one adjacent to the destination object
  `KeyPath`
  `getPath()`
  Get the keys in the path, ordered from source to destination
  `TraceObject`
  `getSource(TraceObject ifEmpty)`
  Get the source object
  `static DBTraceObjectValPath`
  `of()`
  `static DBTraceObjectValPath`
  `of(DBTraceObjectValue... entries)`
  `static DBTraceObjectValPath`
  `of(Collection<DBTraceObjectValue> entryList)`
  `DBTraceObjectValPath`
  `prepend(TraceObjectValue entry)`
  Prepend the entry to this path, generating a new path

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

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### EMPTY

    public static final DBTraceObjectValPath EMPTY

- ## Method Details

  - ### of

    public static DBTraceObjectValPath of()

  - ### of

    public static DBTraceObjectValPath of(Collection<DBTraceObjectValue> entryList)

  - ### of

    public static DBTraceObjectValPath of(DBTraceObjectValue... entries)

  - ### compareTo

    public int compareTo(TraceObjectValPath that)
    Specified by:
      `compareTo` in interface `Comparable<TraceObjectValPath>`

  - ### getEntryList

    public List<DBTraceObjectValue> getEntryList()
    Description copied from interface: `TraceObjectValPath`
    Get the values in the path, ordered from source to destination
    Specified by:
      `getEntryList` in interface `TraceObjectValPath`
    Returns:
      the list of value entries

  - ### computePath

    protected KeyPath computePath()

  - ### getPath

    public KeyPath getPath()
    Description copied from interface: `TraceObjectValPath`
    Get the keys in the path, ordered from source to destination

    The returned list is suited for testing with `PathFilter` or other path-manipulation methods.

    Specified by:
      `getPath` in interface `TraceObjectValPath`
    Returns:
      the list of keys

  - ### contains

    public boolean contains(TraceObjectValue entry)
    Description copied from interface: `TraceObjectValPath`
    Check if a given value appears on this path
    Specified by:
      `contains` in interface `TraceObjectValPath`
    Parameters:
      `entry` - the value entry to check
    Returns:
      true if it appears on the path, false otherwise

  - ### prepend

    public DBTraceObjectValPath prepend(TraceObjectValue entry)
    Description copied from interface: `TraceObjectValPath`
    Prepend the entry to this path, generating a new path

    This performs no validation. The child of the given entry should be the parent of the first entry in this path.

    Specified by:
      `prepend` in interface `TraceObjectValPath`
    Parameters:
      `entry` - the entry to prepend
    Returns:
      the new path

  - ### append

    public DBTraceObjectValPath append(TraceObjectValue entry)
    Description copied from interface: `TraceObjectValPath`
    Append the entry to this path, generating a new path

    This performs no validation. The parent of the given entry should be the child of the last entry in this path.

    Specified by:
      `append` in interface `TraceObjectValPath`
    Parameters:
      `entry` - the entry to append
    Returns:
      the new path

  - ### getFirstEntry

    public DBTraceObjectValue getFirstEntry()
    Description copied from interface: `TraceObjectValPath`
    Get the first entry, i.e., the one adjacent to the source object
    Specified by:
      `getFirstEntry` in interface `TraceObjectValPath`
    Returns:
      the entry, or null if the path is empty

  - ### getSource

    public TraceObject getSource(TraceObject ifEmpty)
    Description copied from interface: `TraceObjectValPath`
    Get the source object

    This returns the parent object of the first entry of the path, unless the path is empty. If the path is empty, then this returns the value passed in `ifEmpty`, which is presumably the destination object.

    Specified by:
      `getSource` in interface `TraceObjectValPath`
    Parameters:
      `ifEmpty` - the object to return when this path is empty
    Returns:
      the source object

  - ### getLastEntry

    public DBTraceObjectValue getLastEntry()
    Description copied from interface: `TraceObjectValPath`
    Get the last entry, i.e., the one adjacent to the destination object
    Specified by:
      `getLastEntry` in interface `TraceObjectValPath`
    Returns:
      the entry, or null if the path is empty

  - ### getDestinationValue

    public Object getDestinationValue(Object ifEmpty)
    Description copied from interface: `TraceObjectValPath`
    Get the destination value

    This returns the value of the last entry of the path, unless the path is empty. If the path is empty, then this returns the object passed in `ifEmpty`, which is presumably the source object. Note that values may be a primitive, so the destination is not always an object, i.e., `TraceObject`. Use `TraceObjectValPath.getDestination(TraceObject)` to assume the destination is an object.

    Specified by:
      `getDestinationValue` in interface `TraceObjectValPath`
    Parameters:
      `ifEmpty` - the value to return when the path is empty
    Returns:
      the destination value

  - ### getDestination

    public TraceObject getDestination(TraceObject ifEmpty)
    Description copied from interface: `TraceObjectValPath`
    Get the destination object

    This returns the child object of the last entry of the path, unless the path is empty. If the path is empty, then this returns the object passed in `ifEmpty`, which is presumably the source object. Note that values may be primitive, so the destination is not always an object, i.e., `TraceObject`. Use `TraceObjectValPath.getDestinationValue(Object)` when it is not safe to assume the destination is an object.

    Specified by:
      `getDestination` in interface `TraceObjectValPath`
    Parameters:
      `ifEmpty` - the object to return when the path is empty
    Returns:
      the destination object