## com.ibm.lab.soln.usingjdt.refactoring
Class NumberGenerator

    java.lang.Object
      |
      +--com.ibm.lab.soln.usingjdt.refactoring.NumberGenerator

Direct Known Subclasses:
  PrimeFactorialGenerator, PrimeNumberGenerator

public class NumberGenerator
extends java.lang.Object

Class `NumberGenerator` is a superclass for `PrimeNumberGenerator` and `PrimeFactorialGenerator` . It is used in a number of the exercises to illustrate different capabilities of the Java Development Tools (JDT).

Field Summary
`protected int` | `quantity` Field `quantity` is the number of numbers to generate, starting with 2.
`protected java.lang.Object[]` | `results` Field `results` contains the generated numbers.

Constructor Summary
`NumberGenerator()`

Method Summary
`void` | `generateNumbers()` Method `generateNumbers` is overridden by subclasses of `NumberGenerator` to generate specific types of numbers.
`int` | `getQuantity()` Method `getQuantity` returns the number of numbers to generate.
`java.lang.Object[]` | `getResults()` Method `getResults` returns the generated numbers.
`void` | `outputResults(java.lang.String prefix)` Method `outputResults` outputs the generated numbers.
`void` | `setQuantity(int quan)` Method `setQuantity` sets the number of numbers to generate.
`void` | `setResults(java.lang.Object[] results)` Method `setResults` sets the generated numbers.
`void` | `sortResults()` Method `sortResults` sorts the numbers in reverse order.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### quantity

    protected int quantity

  Field `quantity` is the number of numbers to generate, starting with 2.

### results

    protected java.lang.Object[] results

  Field `results` contains the generated numbers.

Constructor Detail

### NumberGenerator

    public NumberGenerator()

Method Detail

### generateNumbers

    public void generateNumbers()

  Method `generateNumbers` is overridden by subclasses of `NumberGenerator` to generate specific types of numbers.

### getQuantity

    public int getQuantity()

  Method `getQuantity` returns the number of numbers to generate.

  Returns:
    int

### getResults

    public java.lang.Object[] getResults()

  Method `getResults` returns the generated numbers.

  Returns:
    Object[]

### outputResults

    public void outputResults(java.lang.String prefix)

  Method `outputResults` outputs the generated numbers.

  Parameters:
    `prefix` - String added to the front of each line of output. Used to distinguish output from different threads.

### setQuantity

    public void setQuantity(int quan)

  Method `setQuantity` sets the number of numbers to generate.

  Parameters:
    `quan` - Number of numbers to be generated

### setResults

    public void setResults(java.lang.Object[] results)

  Method `setResults` sets the generated numbers.

  Parameters:
    `results` - Array of generated prime numbers

### sortResults

    public void sortResults()

  Method `sortResults` sorts the numbers in reverse order. The example may seem a bit contrived. It is included to demonstrate generating inner classes.