import gdi.GdiMath; // fuer Methode isPrime(int)
/** Grundlagen der Informatik
*
Geordneter Primzahlencontainer der Groesse N
*/
public class PrimContainer {
// Konstruktor
public PrimContainer(int N) {
primFeld = new int[N+1];
int probe = 2;
// Belegung des Feldes
for (int i = 1; i <= N; i++) {
while (!GdiMath.isPrime(probe))
probe++;
primFeld[i] = probe;
probe++;
}
}
public int [] primFeld;
} // PrimContainer