| java.lang.Object com.sun.pdfview.BaseWatchable
All known Subclasses: com.sun.pdfview.PDFRenderer, com.sun.pdfview.PDFParser,
BaseWatchable | abstract public class BaseWatchable implements Watchable,Runnable(Code) | | An abstract implementation of the watchable interface, that is extended
by the parser and renderer to do their thing.
|
Method Summary | |
protected void | cleanup() Clean up after a set of iterations. | protected synchronized void | execute(boolean synchronous) | public int | getStatus() | public synchronized void | go() Start this watchable and run in a new thread until it is finished or
stopped. | public synchronized void | go(boolean synchronous) Start this watchable and run until it is finished or stopped. | public synchronized void | go(int steps) Start this watchable and run for the given number of steps or until
finished or stopped. | public synchronized void | go(long millis) Start this watchable and run for the given amount of time, or until
finished or stopped. | public boolean | isExecutable() | public boolean | isFinished() Return whether this watchable has finished. | abstract protected int | iterate() Perform a single iteration of this watchable. | public void | run() | protected void | setError(Exception error) | protected void | setStatus(int status) | protected void | setup() Prepare for a set of iterations. | public void | stop() Stop this watchable. | public void | waitForFinish() |
BaseWatchable | protected BaseWatchable()(Code) | | Creates a new instance of BaseWatchable
|
cleanup | protected void cleanup()(Code) | | Clean up after a set of iterations. Called after iteration has stopped
due to completion, manual stopping, or error.
|
execute | protected synchronized void execute(boolean synchronous)(Code) | | Start executing this watchable
Parameters: synchronous - if true, run in this thread |
getStatus | public int getStatus()(Code) | | Get the status of this watchable
one of the well-known statuses |
go | public synchronized void go()(Code) | | Start this watchable and run in a new thread until it is finished or
stopped.
Note the watchable may be stopped if go() with a
different time is called during execution.
|
go | public synchronized void go(boolean synchronous)(Code) | | Start this watchable and run until it is finished or stopped.
Note the watchable may be stopped if go() with a
different time is called during execution.
Parameters: synchronous - if true, run in this thread |
go | public synchronized void go(int steps)(Code) | | Start this watchable and run for the given number of steps or until
finished or stopped.
Parameters: steps - the number of steps to run for |
go | public synchronized void go(long millis)(Code) | | Start this watchable and run for the given amount of time, or until
finished or stopped.
Parameters: millis - the number of milliseconds to run for |
isExecutable | public boolean isExecutable()(Code) | | return true if this watchable is ready to be executed
|
isFinished | public boolean isFinished()(Code) | | Return whether this watchable has finished. A watchable is finished
when its status is either COMPLETED, STOPPED or ERROR
|
iterate | abstract protected int iterate() throws Exception(Code) | | Perform a single iteration of this watchable. This is the minimum
granularity which the go() commands operate over.
one of three values: - Watchable.RUNNING if there is still data to be processed
- Watchable.NEEDS_DATA if there is no data to be processed butthe execution is not yet complete
- Watchable.COMPLETED if the execution is complete
|
setError | protected void setError(Exception error)(Code) | | Set an error on this watchable
|
setStatus | protected void setStatus(int status)(Code) | | Set the status of this watchable
|
setup | protected void setup()(Code) | | Prepare for a set of iterations. Called before the first iterate() call
in a sequence. Subclasses should extend this method if they need to do
anything to setup.
|
stop | public void stop()(Code) | | Stop this watchable. Stop will cause all processing to cease,
and the watchable to be destroyed.
|
waitForFinish | public void waitForFinish()(Code) | | Wait for this watchable to finish
|
|
|