ballWorlds.framework
Class BallManagerWorld

java.lang.Object
  extended by ballWorlds.framework.BallManagerWorld
All Implemented Interfaces:
BallManager
Direct Known Subclasses:
VisibleWorld

public class BallManagerWorld
extends Object
implements BallManager

An BallManagerWorld provides a thread-safe implementation of BallManager, subject to the CAUTION below. It maintains the List of all Balls in its World.

The methods in this class that modify or iterate through this BallManager's List of Balls are synchronized. This prevents the ConcurrentModificationException that might arise if one Thread (e.g. the GUI Thread) adds or removes a Ball from the List of Balls while another Thread (e.g. the Thread that asks each Ball to "act") is iterating through the List of Balls.

CAUTION: Two methods return the List of Balls maintained by this BallManager: