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, yield
public 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
CollisionException
public void broadcastOne() throws CollisionException
CollisionException
public void broadcast(java.lang.String bits) throws CollisionException
CollisionException
public java.lang.String toString()
toString
in class java.lang.Thread
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void setListener(BitListener l)
public boolean isSilent()
public int getID()