ballWorlds.framework
Class WorldWithTwoOrThreeThreads
java.lang.Object
ballWorlds.framework.BallManagerWorld
ballWorlds.framework.VisibleWorld
ballWorlds.framework.WorldWithTwoOrThreeThreads
- All Implemented Interfaces:
- BallManager, Drawable, World, WorldDescriber, Runnable
public class WorldWithTwoOrThreeThreads
- extends VisibleWorld
- implements Runnable
TODO Put here a description of this class: what its objects are and/or do.
- Author:
- mutchler. Created Sep 20, 2009.
|
Method Summary |
void |
addBall(Ball ballToAdd)
Adds the given Ball to this World. |
void |
removeBall(Ball ballToRemove)
Removes the given Ball from this World. |
void |
run()
Repeatedly asks each Ball to act. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WorldWithTwoOrThreeThreads
public WorldWithTwoOrThreeThreads(List<World> universe,
Dimension size,
Color color,
JFrame ballWorldFrame,
boolean hasThreeThreads)
- TODO Put here a description of what this constructor does.
- Parameters:
universe - size - color - ballWorldFrame -
addBall
public void addBall(Ball ballToAdd)
- Description copied from interface:
BallManager
- Adds the given Ball to this World.
- Specified by:
addBall in interface BallManager- Overrides:
addBall in class BallManagerWorld
- Parameters:
ballToAdd - the Ball to add to this World.
removeBall
public void removeBall(Ball ballToRemove)
- Description copied from interface:
BallManager
- Removes the given Ball from this World.
- Specified by:
removeBall in interface BallManager- Overrides:
removeBall in class BallManagerWorld
- Parameters:
ballToRemove - the Ball to remove from this World.
run
public void run()
- Repeatedly asks each Ball to act.
- Specified by:
run in interface Runnable