FileDocCategorySizeDatePackage
CharacterEventHandler.javaAPI DocExample706Sun Mar 14 11:28:38 GMT 2004javathreads.examples.ch11

CharacterEventHandler

public class CharacterEventHandler extends Object

Fields Summary
private Vector
listeners
Constructors Summary
Methods Summary
public voidaddCharacterListener(CharacterListener cl)


        
        listeners.add(cl);
    
public voidfireNewCharacter(CharacterSource source, int c)

        CharacterEvent ce = new CharacterEvent(source, c);
        CharacterListener[] cl = (CharacterListener[] )
                                 listeners.toArray(new CharacterListener[0]);
        for (int i = 0; i < cl.length; i++)
            cl[i].newCharacter(ce);
    
public voidremoveCharacterListener(CharacterListener cl)

        listeners.remove(cl);