Interface TraceTimeManager

All Known Implementing Classes:
DBTraceTimeManager

public interface TraceTimeManager
  • Field Details

  • Method Details

    • createSnapshot

      TraceSnapshot createSnapshot(String description)
      Create a new snapshot after the latest
      Parameters:
      description - a description of the new snapshot, i.e., the reason for advancing
      Returns:
      the created snapshot
    • getSnapshot

      TraceSnapshot getSnapshot(long snap, boolean createIfAbsent)
      Get the snapshot with the given key, optionally creating it
      Parameters:
      snap - the snapshot key
      createIfAbsent - create the snapshot if it's missing
      Returns:
      the snapshot or null
    • getMostRecentSnapshot

      TraceSnapshot getMostRecentSnapshot(long snap)
      Get the most recent snapshot since a given key
      Parameters:
      snap - the snapshot key
      Returns:
      the snapshot or null
    • getSnapshotsWithSchedule

      Collection<? extends TraceSnapshot> getSnapshotsWithSchedule(TraceSchedule schedule)
      Get all snapshots with the given schedule

      Ideally, the snapshot schedules should be managed such that the returned collection contains at most one snapshot.

      Parameters:
      schedule - the schedule to find
      Returns:
      the snapshots
    • findScratchSnapshot

      TraceSnapshot findScratchSnapshot(TraceSchedule schedule)
      Find or create a the snapshot with the given schedule

      If a snapshot with the given schedule already exists, this returns the first such snapshot found. Ideally, there is exactly one. If this method is consistently used for creating scratch snapshots, then that should always be the case. If no such snapshot exists, this creates a snapshot with the minimum available negative snapshot key, that is starting at Long.MIN_VALUE and increasing from there.

      Parameters:
      schedule - the schedule to find
      Returns:
      the snapshot
    • getAllSnapshots

      Collection<? extends TraceSnapshot> getAllSnapshots()
      List all snapshots in the trace
      Returns:
      the set of snapshots
    • getSnapshots

      Collection<? extends TraceSnapshot> getSnapshots(long fromSnap, boolean fromInclusive, long toSnap, boolean toInclusive)
      List all snapshots between two given snaps in the trace
      Parameters:
      fromSnap - the starting snap
      fromInclusive - whether to include the from snap
      toSnap - the ending snap
      toInclusive - when to include the to snap
      Returns:
      the set of snapshots
    • getMaxSnap

      Long getMaxSnap()
      Get maximum snapshot key that has ever existed, usually that of the latest snapshot Note, the corresponding snapshot need not exist, as it may have been deleted.
      Returns:
      the key, or null if no snapshots have existed
    • getSnapshotCount

      long getSnapshotCount()
      Get the number of snapshots
      Returns:
      the count
    • setTimeRadix

      void setTimeRadix(TraceSchedule.TimeRadix radix)
      Set the radix for displaying and parsing time (snapshots and step counts)

      This only affects the GUI, but storing it in the trace gives the back end a means of controlling it.

      Parameters:
      radix - the radix
    • getTimeRadix

      TraceSchedule.TimeRadix getTimeRadix()
      Get the radix for displaying and parsing time (snapshots and step counts)
      Returns:
      radix the radix
      See Also: