ballWorlds.framework
Class WorldWithTwoOrThreeThreads

java.lang.Object
  extended by ballWorlds.framework.BallManagerWorld
      extended by ballWorlds.framework.VisibleWorld
          extended by 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.

Constructor Summary
WorldWithTwoOrThreeThreads(List<World> universe, Dimension size, Color color, JFrame ballWorldFrame, boolean hasThreeThreads)
          TODO Put here a description of what this constructor does.
 
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 ballWorlds.framework.VisibleWorld
drawBalls, getAllWorlds, getAnotherWorld, getColor, getShape, getView, isInsideWorldX, isInsideWorldY, middleOfWorld, randomPointInWorld
 
Methods inherited from class ballWorlds.framework.BallManagerWorld
allBallsInWorld, getBallsInWorld, intersectingBall, intersectingBalls, nearestBall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ballWorlds.BallManager
allBallsInWorld, intersectingBall, intersectingBalls, nearestBall
 

Constructor Detail

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 -
Method Detail

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