utility
Class TrajectoryGenerator

java.lang.Object
  extended by utility.TrajectoryGenerator

public class TrajectoryGenerator
extends java.lang.Object

This class encapsulates a generator for a trajectory for a particle. Its primary service is provided via the getNextPoint() method.

Author:
mb

Constructor Summary
TrajectoryGenerator(int horizontalDimension, int verticalDimension)
          Construct an instance of a generator of a trajectory.
 
Method Summary
 java.awt.Point getNextPoint()
          This method returns the next point of this particle's trajectory.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrajectoryGenerator

public TrajectoryGenerator(int horizontalDimension,
                           int verticalDimension)
Construct an instance of a generator of a trajectory. The generated trajectory will not venture out of the bounds passed to this constructor.

Parameters:
horizontalDimension - a non-zero positive value
verticalDimension - a non-zero positive value
Method Detail

getNextPoint

public java.awt.Point getNextPoint()
This method returns the next point of this particle's trajectory. It is randomly chosen from among a finite set of possible next moves in any possible direction. The next point will not venture out of bounds.

Returns:
as described above.