String Transformers Problem Set Javadocs

cs101.util
Class AnimateObject

java.lang.Object
  extended bycs101.util.AnimateObject
All Implemented Interfaces:
Animate
Direct Known Subclasses:
StringTransformer

public abstract class AnimateObject
extends java.lang.Object
implements Animate

The generic self-animating (active) object. Extend it, overriding its act() method, to generate interesting behavior. Copyright 1999 Massachusetts Institute of Technology

Version:
$Id: AnimateObject.java,v 1.1.1.1 2002/06/05 21:56:32 root Exp $
Author:
Lynn Andrea Stein, las@ai.mit.edu
See Also:
AnimatorThread, Animate

Field Summary
static boolean DONT_START_YET
          These constants allow mnemonic access to AnimateObject's final constructor argument, i.e., should the object start running on construction or on (a subsequent) call to a separate start() method?
protected  AnimatorThread spirit
          The animacy that makes this object go.
static boolean START_IMMEDIATELY
          These constants allow mnemonic access to AnimateObject's final constructor argument, i.e., should the object start running on construction or on (a subsequent) call to a separate start() method?
 
Constructor Summary
AnimateObject()
          The most basic constructor creates the AnimateObject and starts its animacy going.
AnimateObject(boolean startImmediately)
          This constructor allows you to create an AnimateObject without starting its animacy going.
 
Method Summary
abstract  void act()
          Override this method to give the AnimateObject behavior.
 void start()
          Invocation of this method begins this object's autonomous execution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

START_IMMEDIATELY

public static boolean START_IMMEDIATELY
These constants allow mnemonic access to AnimateObject's final constructor argument, i.e., should the object start running on construction or on (a subsequent) call to a separate start() method?

See Also:
AnimateObject( boolean )

DONT_START_YET

public static boolean DONT_START_YET
These constants allow mnemonic access to AnimateObject's final constructor argument, i.e., should the object start running on construction or on (a subsequent) call to a separate start() method?

See Also:
AnimateObject( boolean )

spirit

protected AnimatorThread spirit
The animacy that makes this object go.

See Also:
AnimatorThread
Constructor Detail

AnimateObject

public AnimateObject()
The most basic constructor creates the AnimateObject and starts its animacy going.


AnimateObject

public AnimateObject(boolean startImmediately)
This constructor allows you to create an AnimateObject without starting its animacy going. (You do this by calling this constructor with AnimateObject.DONT_START_YET, i.e., the boolean false. If you do this, the animacy will not actually begin execution until you call this AnimateObject's start() method.

Parameters:
startImmediately - If false, execution does not start until explicit invocation of this object's start() method.
See Also:
START_IMMEDIATELY, DONT_START_YET
Method Detail

start

public void start()
Invocation of this method begins this object's autonomous execution. (If execution has already begun, this method does nothing.)

See Also:
AnimateObject( boolean )

act

public abstract void act()
Override this method to give the AnimateObject behavior. The default behavior -- Thread.yield() -- simply gives other animacies a chance to run.

Specified by:
act in interface Animate

String Transformers Problem Set Javadocs