Class Recorder

java.lang.Object
  extended by greenfoot.Actor
      extended by Recorder

public class Recorder
extends greenfoot.Actor

The recorder keeps track of how many letters have been pressed and can tell if all have been pressed.

Version:
Fall 2010 - Lab 5
Author:
Adrienne Decker

Constructor Summary
Recorder()
          Creates an instance of the Recorder with an empty collection of letters already pressed.
 
Method Summary
 void act()
          Act - do whatever the Recorder wants to do.
 boolean allPressed()
          This method returns true when all the letters have been pressed, false otherwise.
 void keyPressed(java.lang.String key)
          Call this method whenever a key is pressed by the user so that the recorder records that the key has been pressed.
 
Methods inherited from class greenfoot.Actor
addedToWorld, getImage, getIntersectingObjects, getNeighbours, getObjectsAtOffset, getObjectsInRange, getOneIntersectingObject, getOneObjectAtOffset, getRotation, getWorld, getX, getY, intersects, setImage, setImage, setLocation, setRotation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Recorder

public Recorder()
Creates an instance of the Recorder with an empty collection of letters already pressed.

Method Detail

act

public void act()
Act - do whatever the Recorder wants to do. This method is called whenever the 'Act' or 'Run' button gets pressed in the environment.

Overrides:
act in class greenfoot.Actor

allPressed

public boolean allPressed()
This method returns true when all the letters have been pressed, false otherwise.


keyPressed

public void keyPressed(java.lang.String key)
Call this method whenever a key is pressed by the user so that the recorder records that the key has been pressed.