Package ghidra.trace.model.time.schedule

# Class AbstractStep

java.lang.Object
ghidra.trace.model.time.schedule.AbstractStep

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

Direct Known Subclasses:
  `SkipStep`, `TickStep`

public abstract class AbstractStep extends Object implements Step

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface ghidra.trace.model.time.schedule.Step

  `Step.StepType`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final long`
  `threadKey`
  `protected long`
  `tickCount`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `AbstractStep(long threadKey, long tickCount)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addTo(Step step)`
  `void`
  `advance(long steps)`
  Add to the count of this step
  `abstract AbstractStep`
  `clone()`
  `long`
  `coalescePatches(Language language, List<Step> steps)`
  `CompareResult`
  `compareStep(Step step)`
  Richly compare this step to another
  `boolean`
  `equals(Object obj)`
  `long`
  `getPatchCount()`
  `long`
  `getThreadKey()`
  `long`
  `getTickCount()`
  `int`
  `hashCode()`
  `boolean`
  `isCompatible(Step step)`
  Check if the given step can be combined with this one
  `boolean`
  `isNop()`
  `long`
  `rewind(long steps)`
  Subtract from the count of this step
  `String`
  `toString()`
  `String`
  `toString(TraceSchedule.TimeRadix radix)`
  `protected abstract String`
  `toStringStepPart(TraceSchedule.TimeRadix radix)`
  Return the step portion of `toString()`

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

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

  ### Methods inherited from interface ghidra.trace.model.time.schedule.Step

  `compareStepType, compareTo, execute, execute, getSkipCount, getThread, getType, getTypeOrder, isEventThread, subtract`

- ## Field Details

  - ### threadKey

    protected final long threadKey

  - ### tickCount

    protected long tickCount

- ## Constructor Details

  - ### AbstractStep

    protected AbstractStep(long threadKey, long tickCount)

- ## Method Details

  - ### toStringStepPart

    protected abstract String toStringStepPart(TraceSchedule.TimeRadix radix)
    Return the step portion of `toString()`
    Parameters:
      `radix` - the radix
    Returns:
      the string

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### toString

    public String toString(TraceSchedule.TimeRadix radix)
    Specified by:
      `toString` in interface `Step`

  - ### isNop

    public boolean isNop()
    Specified by:
      `isNop` in interface `Step`

  - ### getThreadKey

    public long getThreadKey()
    Specified by:
      `getThreadKey` in interface `Step`

  - ### getTickCount

    public long getTickCount()
    Specified by:
      `getTickCount` in interface `Step`

  - ### getPatchCount

    public long getPatchCount()
    Specified by:
      `getPatchCount` in interface `Step`

  - ### clone

    public abstract AbstractStep clone()
    Specified by:
      `clone` in interface `Step`
    Overrides:
      `clone` in class `Object`

  - ### advance

    public void advance(long steps)
    Add to the count of this step
    Parameters:
      `steps` - the count to add

  - ### rewind

    public long rewind(long steps)
    Description copied from interface: `Step`
    Subtract from the count of this step

    If this step has a count exceeding that given, then this method simply subtracts the given number from the `tickCount` and returns the (negative) difference. If this step has exactly the count given, this method sets the count to 0 and returns 0, indicating this step should be removed from the sequence. If the given count exceeds that of this step, this method sets the count to 0 and returns the (positive) difference, indicating this step should be removed from the sequence, and the remaining steps rewound from the preceding step.

    Specified by:
      `rewind` in interface `Step`
    Parameters:
      `steps` - the count to rewind
    Returns:
      the number of steps remaining

  - ### isCompatible

    public boolean isCompatible(Step step)
    Description copied from interface: `Step`
    Check if the given step can be combined with this one

    Two steps applied to the same thread can just be summed. If the given step applies to the "last thread" or to the same thread as this step, then it can be combined.

    Specified by:
      `isCompatible` in interface `Step`
    Parameters:
      `step` - the second step
    Returns:
      true if combinable, false otherwise.

  - ### addTo

    public void addTo(Step step)
    Specified by:
      `addTo` in interface `Step`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`

  - ### compareStep

    public CompareResult compareStep(Step step)
    Description copied from interface: `Step`
    Richly compare this step to another
    Specified by:
      `compareStep` in interface `Step`
    Parameters:
      `step` - the object of comparison (this being the subject)
    Returns:
      a result describing the relationship from subject to object

  - ### coalescePatches

    public long coalescePatches(Language language, List<Step> steps)
    Specified by:
      `coalescePatches` in interface `Step`