|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectPrime
public class Prime
Utlity class for finding prime numbers (useful for making hash tables).
Field Summary | |
---|---|
private static int[] |
primeList
A handy quick-reference table of primes 1 .. 2^31, spaced evenly in a logarithmic sense. |
Constructor Summary | |
---|---|
Prime()
|
Method Summary | |
---|---|
static int |
findAfter(int n)
Determines a prime number greater than n, but not too much greater. |
private static BitSet |
makePrimeSet(int n)
Makes a bit set of primes below n. |
static void |
printPrimeList(int n,
float v)
Print a list of primes 1..n, evenly spaced at intervals v |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static int[] primeList
Constructor Detail |
---|
public Prime()
Method Detail |
---|
public static int findAfter(int n)
private static BitSet makePrimeSet(int n)
public static void printPrimeList(int n, float v)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |