public class BitHandler
extends java.lang.Thread
| Modifier and Type | Field and Description |
|---|---|
static int |
HALFPERIOD |
| Constructor and Description |
|---|
BitHandler() |
BitHandler(java.lang.String host,
int port) |
| Modifier and Type | Method and Description |
|---|---|
void |
broadcast(java.lang.String bits)
Given a string of bits (0s and 1s), send each bit using broadcastOne/Zero().
|
void |
broadcastOne()
Turn the light system off (if it isn't already), then wait half
a period.
|
void |
broadcastZero()
Turn the light system on (if it isn't already), then wait half
a period.
|
int |
getID() |
boolean |
isSilent() |
static void |
pause(int milliseconds) |
void |
run()
Repeatedly (and as fast as possible), check if the panel's light has changed from on to off
or vice versa.
|
void |
setListener(BitListener l) |
java.lang.String |
toString() |
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, yieldpublic static final int HALFPERIOD
public BitHandler()
public BitHandler(java.lang.String host,
int port)
public static void pause(int milliseconds)
public void broadcastZero()
throws CollisionException
CollisionExceptionpublic void broadcastOne()
throws CollisionException
CollisionExceptionpublic void broadcast(java.lang.String bits)
throws CollisionException
CollisionExceptionpublic java.lang.String toString()
toString in class java.lang.Threadpublic void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void setListener(BitListener l)
public boolean isSilent()
public int getID()