Algorithm
Development Kit 1.0

algs.model.data.points
Class HorizontalLineGenerator

java.lang.Object
  extended by algs.model.data.Generator<IPoint>
      extended by algs.model.data.points.HorizontalLineGenerator

public class HorizontalLineGenerator
extends Generator<IPoint>

Generate a set of points that all exist on a horizontal line.

The y-coordinate of each generated point is determined by the generator. The x-cooordinate of each point is an integer multiple of 10.

Since:
1.0
Version:
1.0, 6/15/08
Author:
George Heineman

Field Summary
 double yValue
          location of horizontal line.
 
Constructor Summary
HorizontalLineGenerator(double yValue)
           
 
Method Summary
 Generator<IPoint> construct(java.lang.String[] args)
          Provide reflective behavior to construct instance of generator given an array of string arguments.
 TwoDPoint[] generate(int size)
          Generate a set of |size| points all along a horizontal line (x,99).
 java.lang.String[] parameters()
          Declares the name of the parameters used when constructing the generator in order from left to right.
 
Methods inherited from class algs.model.data.Generator
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

yValue

public final double yValue
location of horizontal line.

Constructor Detail

HorizontalLineGenerator

public HorizontalLineGenerator(double yValue)
Method Detail

parameters

public java.lang.String[] parameters()
Description copied from class: Generator
Declares the name of the parameters used when constructing the generator in order from left to right.

Specified by:
parameters in class Generator<IPoint>

construct

public Generator<IPoint> construct(java.lang.String[] args)
Provide reflective behavior to construct instance of generator given an array of string arguments.

Specified by:
construct in class Generator<IPoint>

generate

public TwoDPoint[] generate(int size)
Generate a set of |size| points all along a horizontal line (x,99). Each point has an x-coordinate that is a multiple of 10.

Specified by:
generate in class Generator<IPoint>
Parameters:
size - number of points to generate

Algorithm Development Kit 1.0

This code supports the Algorithms in a Nutshell book, published by O'Reilly Media, Inc. in November 2008. Please visit the book web page to learn of any changes to the code repository or to record a potential defect.