## com.ibm.lab.soln.usingjdt.codegeneration
Class PrimeNumberGenerator

    java.lang.Object
      |
      +--com.ibm.lab.soln.usingjdt.codegeneration.PrimeNumberGenerator

public class PrimeNumberGenerator
extends java.lang.Object

Class `PrimeNumberGenerator` generates a series of prime numbers starting with 2. The class is used in a number of the exercises to illustrate different capabilities of the Java Development Tools (JDT). Several versions of this class exist in different packages in this project and in packages in other projects. These different versions are used in the different parts of the exercises.

Field Summary
`int` | `quan` Field `quan` is the number of prime numbers to generate, starting with 2.

Constructor Summary
`PrimeNumberGenerator()`

Method Summary
`void` | `generatePrimeNumbers()` Method `generatePrimeNumbers` generates `quan` prime numbers.
`java.lang.Object[]` | `getResults()` Method `getResults` returns the generated prime numbers.
`void` | `outputResults(java.lang.String prefix)` Method `outputResults` outputs the generated prime numbers.
`void` | `setResults(java.lang.Object[] results)` Method `setResults` sets generated prime numbers.
`void` | `sortResults()` Method `sortResults` sorts the prime numbers in reverse order.

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

Field Detail

### quan

    public int quan

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

Constructor Detail

### PrimeNumberGenerator

    public PrimeNumberGenerator()

Method Detail

### generatePrimeNumbers

    public void generatePrimeNumbers()

  Method `generatePrimeNumbers` generates `quan` prime numbers.

### getResults

    public java.lang.Object[] getResults()

  Method `getResults` returns the generated prime numbers.

  Returns:
    Object[]

### outputResults

    public void outputResults(java.lang.String prefix)

  Method `outputResults` outputs the generated prime numbers.

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

### setResults

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

  Method `setResults` sets generated prime numbers.

  Parameters:
    `results` - Array of generated prime numbers

### sortResults

    public void sortResults()

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