Class SpyThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--SpyThread
All Implemented Interfaces:
java.lang.Runnable

class SpyThread
extends java.lang.Thread

Spies on an object once per second and displays the results in a SpyWindow.


Field Summary
(package private)  boolean okay
          When this becomes false (via cancel, we're done.
(package private)  java.lang.Object spyInfo
          An arbitrary object containing information about what we're spying on.
(package private)  SpyWindow spyWindow
          The window in which our information is being displayed
 
Fields inherited from class java.lang.Thread
inheritableThreadLocals, MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY, threadLocals
 
Constructor Summary
(package private) SpyThread(java.lang.Object argSpyInfo)
          Note what it is that we're spying on.
 
Method Summary
 void cancel()
          Called from a cancel button and causes us to stop spying and go home.
 void run()
          The thread's main method.
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

okay

boolean okay
When this becomes false (via cancel, we're done.

spyInfo

java.lang.Object spyInfo
An arbitrary object containing information about what we're spying on. If it's of class Spyable, we will call its runSpy method; otherwise, we'll just call toString.

spyWindow

SpyWindow spyWindow
The window in which our information is being displayed
Constructor Detail

SpyThread

SpyThread(java.lang.Object argSpyInfo)
Note what it is that we're spying on.
Parameters:
argSpyInfo - the target of our interest
Method Detail

cancel

public void cancel()
Called from a cancel button and causes us to stop spying and go home.

run

public void run()
The thread's main method. Loops forever (or at least until somebody tells us to stop) and every second tells the world what's going on with an object.
Overrides:
run in class java.lang.Thread