public interface IPrimeSieve
An interface for a prime number sieve.
Method Summary | |
---|---|
IPrimeCollection |
getCollection()
The default collection of the full sieve. |
IPrimeCollection |
getCollection(int
low, int high) Gives the collection of the prime numbers in the range [low, high]. |
IPrimeCollection |
getCollection(PositiveRange
range) Gives the collection of the prime numbers in the given range. |
int |
getNthPrime(int
n) Get the n-th prime number. |
boolean |
isPrime(int
i) Checks if a given number is prime. |
Method Detail |
---|
IPrimeCollection getCollection()
IPrimeCollection getCollection(int low, int high)
low
- The lower bound of the range to be sieved.high
- The upper bound of the range to be sieved. IPrimeCollection getCollection(PositiveRange range)
range
- The range of integers to be sieved. int getNthPrime(int n)
n
- The index of the prime number searched. boolean isPrime(int i)
i
- The number the primelity of which is to be checked.