|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
net.sourceforge.frcsimulator.mistware.Simulator
public class Simulator
The actual simulator, which runs the robot software. Handles initializing the given MIDlet, catching various exceptions, and other tasks. NB: It's mistware because it's even softer than software, but isn't in the cloud.
Nested Class Summary | |
---|---|
static class |
Simulator.Status
Represents the various states the simulator can be in--initalizing, running, stopped, erring, etc. |
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
Simulator(java.lang.String midletClass)
|
Method Summary | |
---|---|
static void |
callErrorMethod(java.lang.reflect.Method handler,
SimulatorError se)
|
static void |
callStatusChangeMethod(java.lang.reflect.Method handler,
Simulator.Status newStatus,
Simulator.Status oldStatus)
|
static void |
displayError(SimulatorError e)
Prints a short status method and a stack trace for the given SimulatorError. |
static void |
err(java.lang.Class source,
java.lang.Thread thread,
java.lang.String error)
|
static void |
fixme(java.lang.Class source,
java.lang.Thread thread,
java.lang.String reason)
|
SimulatorError |
getError()
Get the error which caused the simulator to stop, or null if there was no such error. |
static Simulator |
getInstance()
|
java.util.logging.Logger |
getLogger()
|
Simulator.Status |
getStatus()
|
static void |
msg(java.lang.Class source,
java.lang.Thread thread,
java.lang.String message)
|
java.lang.reflect.Method |
onError(java.lang.reflect.Method handler)
Set a method to call if the simulator throws an error. |
java.lang.reflect.Method |
onStatusChange(java.lang.reflect.Method handler)
Set a method to be called when the status of the simulator changes. |
void |
run()
|
void |
setStatus(Simulator.Status s)
Set the status and call the status change method. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, clone, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Simulator(java.lang.String midletClass) throws java.lang.ClassNotFoundException, java.lang.ClassCastException
midletClass
- The name of the MIDlet class which should be run
inside the simulator; eg. "edu.wpi.first.wpilibj.SimpleRobot
java.lang.ClassNotFoundException
- if the class name given does not actually
exist
java.lang.ClassCastException
- if the class exists, but doesn't extend
MIDlet.Method Detail |
---|
public static Simulator getInstance()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public static void callErrorMethod(java.lang.reflect.Method handler, SimulatorError se)
public static void displayError(SimulatorError e)
e
- The errorpublic java.lang.reflect.Method onError(java.lang.reflect.Method handler)
handler
- The method to call when an error occurs.
public Simulator.Status getStatus()
public void setStatus(Simulator.Status s)
s
- public static void callStatusChangeMethod(java.lang.reflect.Method handler, Simulator.Status newStatus, Simulator.Status oldStatus)
public java.lang.reflect.Method onStatusChange(java.lang.reflect.Method handler)
handler
- The method to call
public SimulatorError getError()
public java.util.logging.Logger getLogger()
public static void msg(java.lang.Class source, java.lang.Thread thread, java.lang.String message)
public static void fixme(java.lang.Class source, java.lang.Thread thread, java.lang.String reason)
public static void err(java.lang.Class source, java.lang.Thread thread, java.lang.String error)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |