client
Class GUI_Client

java.lang.Object
  extended by java.lang.Thread
      extended by client.GUI_Client
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable, java.rmi.Remote

public class GUI_Client
extends java.lang.Thread
implements java.io.Serializable, java.rmi.Remote

Class that interacts with the GUI and the Space to provide the power of the Space to the GUI

Author:
Diana Abbas, Ryan Neal
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static long serialVersionUID
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
GUI_Client(java.lang.String host)
          The Client that will connect to a host running a space.
 
Method Summary
 void finish(Result r)
          A method that will add the result into the resultQ.
 Result getResult()
          Returns the first result in the result Q
 Shared getShared()
          Goes to the Space and requests its shared value.
 boolean hasResult()
          Tells if the client is holding a Result
 boolean isReady()
          Tells if the client is ready to start issuing tasks.
 void run()
          Causes the client to lookup the Space and then start the statistics frame.
 void startTask(Task task)
          The way that a GUI issues a task into the system.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

GUI_Client

public GUI_Client(java.lang.String host)
The Client that will connect to a host running a space. The Space must already be running.

Parameters:
host -
Method Detail

run

public void run()
Causes the client to lookup the Space and then start the statistics frame.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

startTask

public void startTask(Task task)
The way that a GUI issues a task into the system. This will block until a result is back from the Space.

Parameters:
task -

finish

public void finish(Result r)
A method that will add the result into the resultQ. This can be called by a the Space or any other object.

Parameters:
r - the result to be stored

hasResult

public boolean hasResult()
Tells if the client is holding a Result

Returns:
T/F if the result Q is empty

getResult

public Result getResult()
Returns the first result in the result Q

Returns:
the head of the result Q

isReady

public boolean isReady()
Tells if the client is ready to start issuing tasks. Should be checked before using the client to avoid errors.

Returns:
the state of the client

getShared

public Shared getShared()
Goes to the Space and requests its shared value. Then returns that.

Returns: