Algorithm
Development Kit 1.0

algs.model.data
Class Generator<E>

java.lang.Object
  extended by algs.model.data.Generator<E>
Type Parameters:
E - the type of entity being generated.
Direct Known Subclasses:
CircleGenerator, ConvertToND, DoubleGenerator, GridGenerator, HorizontalLineGenerator, HubGenerator, IntegerGenerator, LoadFromFileGenerator, LoadFromFileGenerator, SlidingLadderGenerator, UniformGenerator, UniformGenerator, UniformGenerator, UniformGenerator, UniqueGenerator, UnusualGenerator, VerticalLineGenerator

public abstract class Generator<E>
extends java.lang.Object

Generator of a fixed number of elements.

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

Constructor Summary
Generator()
           
 
Method Summary
abstract  Generator<E> construct(java.lang.String[] args)
          Given the string arguments, construct the desired generator as specified by the appropriate sub-class.
abstract  E[] generate(int size)
          Generate a set of elements according to specialized criteria defined by the subclass.
abstract  java.lang.String[] parameters()
          Declares the name of the parameters used when constructing the generator in order from left to right.
 java.lang.String toString()
          Respond with the name of the appropriate subclass.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Generator

public Generator()
Method Detail

generate

public abstract E[] generate(int size)
Generate a set of elements according to specialized criteria defined by the subclass.

There is no guarantee that the elements are unique.

Parameters:
size - The number of elements to be created.

construct

public abstract Generator<E> construct(java.lang.String[] args)
Given the string arguments, construct the desired generator as specified by the appropriate sub-class.

Parameters:
args -

parameters

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


toString

public java.lang.String toString()
Respond with the name of the appropriate subclass.

Overrides:
toString in class java.lang.Object

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.