Class BaseWatchable.Gate

java.lang.Object
com.sun.pdfview.BaseWatchable.Gate
Enclosing class:
BaseWatchable

class BaseWatchable.Gate extends Object
A class that lets us give it a target time or number of steps, and will tell us to stop after that much time or that many steps
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private long
    the next gate, whether time or iterations
    private boolean
    whether this is a time-based (true) or step-based (false) gate
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Notify the gate of one iteration.
    void
    setStopIterations(int iterations)
    set the number of iterations until we stop
    void
    setStopTime(long millisFromNow)
    set the stop time
    boolean
    check whether we should stop.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • timeBased

      private boolean timeBased
      whether this is a time-based (true) or step-based (false) gate
    • nextGate

      private long nextGate
      the next gate, whether time or iterations
  • Constructor Details

    • Gate

      Gate()
  • Method Details

    • setStopTime

      public void setStopTime(long millisFromNow)
      set the stop time
    • setStopIterations

      public void setStopIterations(int iterations)
      set the number of iterations until we stop
    • stop

      public boolean stop()
      check whether we should stop.
    • iterate

      public boolean iterate()
      Notify the gate of one iteration. Returns true if we should stop or false if not