Methods Summary |
---|
public void | addCharacterListener(CharacterListener cl)
handler.addCharacterListener(cl);
|
public int | getPauseTime(int minTime, int maxTime)
return (int) (minTime + ((maxTime-minTime)*random.nextDouble()));
|
public int | getPauseTime()
return getPauseTime(2000, 5500);
|
public void | nextCharacter()
handler.fireNewCharacter(this,
(int) chars[random.nextInt(chars.length)]);
|
public void | removeCharacterListener(CharacterListener cl)
handler.removeCharacterListener(cl);
|
public void | run()
while (true) {
try {
if (done.get()) {
Thread.sleep(100);
} else {
nextCharacter();
Thread.sleep(getPauseTime());
}
} catch (InterruptedException ex) {
return;
}
}
|
public void | setDone(boolean b)
done.set(b);
|