Ball World Problem Set Javadocs

ballworld
Interface World

All Known Implementing Classes:
BallWorld

public interface World

The World interface describes information that a Ball can get about the World


Method Summary
 void addBall(Ball aNewBall)
          Add a ball to the world
 Ball getClosestBall(Ball myBall)
          returns the Ball object that is closest to myBall (not including myBall).
 double getMaxX()
          return the maximum visible X value of the world
 double getMaxY()
          return the maximum visible Y value of the world
 double getMinX()
          Get minimum visible X value of the world.
 double getMinY()
          return the minimum visible Y value of the world
 void removeBall(Ball toBeRemoved)
          Remove a ball from the world
 

Method Detail

getMinX

public double getMinX()
Get minimum visible X value of the world.

Returns:
The minimum x coordinate

getMinY

public double getMinY()
return the minimum visible Y value of the world

Returns:
The minimum y coordinate

getMaxX

public double getMaxX()
return the maximum visible X value of the world

Returns:
The maximum x coordinate

getMaxY

public double getMaxY()
return the maximum visible Y value of the world

Returns:
The maximum y coordinate

getClosestBall

public Ball getClosestBall(Ball myBall)
returns the Ball object that is closest to myBall (not including myBall). Be careful! If there is only one ball on the screen, then this method will return null

Parameters:
myBall - The ball to find neighbors for
Returns:
The nearest ball if there is one, null otherwise

addBall

public void addBall(Ball aNewBall)
Add a ball to the world

Parameters:
aNewBall - The ball to add

removeBall

public void removeBall(Ball toBeRemoved)
Remove a ball from the world

Parameters:
toBeRemoved - The ball to remove

Ball World Problem Set Javadocs