Methods Summary |
---|
public void | addCharacterListener(CharacterListener cl)
handler.addCharacterListener(cl);
|
public int | getPauseTime()
return (int) (Math.max(1000, 5000 * random.nextDouble()));
|
public void | nextCharacter()
handler.fireNewCharacter(this,
(int) chars[random.nextInt(chars.length)]);
|
public void | removeCharacterListener(CharacterListener cl)
handler.removeCharacterListener(cl);
|
public synchronized void | run()
while (true) {
try {
if (done) {
wait();
} else {
nextCharacter();
wait(getPauseTime());
}
} catch (InterruptedException ie) {
return;
}
}
|
public synchronized void | setDone(boolean b)
done = b;
if (!done)
notify();
|