de.luschny.math.primes
Enum IPrimeCollection.PrintOption

java.lang.Object
java.lang.Enum<IPrimeCollection.PrintOption>
de.luschny.math.primes.IPrimeCollection.PrintOption
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<IPrimeCollection.PrintOption>
Enclosing interface:
IPrimeCollection

public static enum IPrimeCollection.PrintOption
extends java.lang.Enum<IPrimeCollection.PrintOption>

Three options for formatting the list of primes when printing them to a file.


Enum Constant Summary
CommaSeparated
          A comma-separated list of the prime numbers in the collection.
FormattedText
          A formated table of the prime numbers in the collection.
Xml
          The prime numbers as pairs (ordinal, prime) in Xml-format.
 
Method Summary
static IPrimeCollection.PrintOption valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static IPrimeCollection.PrintOption[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

CommaSeparated

public static final IPrimeCollection.PrintOption CommaSeparated
A comma-separated list of the prime numbers in the collection.
Example output:
   2,3,5,7,...


FormattedText

public static final IPrimeCollection.PrintOption FormattedText
A formated table of the prime numbers in the collection.
Example output:

 SieveRange   [100,333] : 234
 PrimeRange   [ 26, 67] : 42
 PrimeDensity 0.1794871794871795

 <26.> 101 103 107 109 113 127 131 137 139 149 151
       157 163 167 173 179 181 191 193 197 199
 <47.> 211 223 227 229 233 239 241 251 257 263 269
       271 277 281 283 293
 <63.> 307 311 313 317 331


Xml

public static final IPrimeCollection.PrintOption Xml
The prime numbers as pairs (ordinal, prime) in Xml-format.
Example output:
 (26,101)
 (27,103)
 (28,107)

Method Detail

valueOf

public static IPrimeCollection.PrintOption valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

values

public static IPrimeCollection.PrintOption[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (IPrimeCollection.PrintOption c : IPrimeCollection.PrintOption.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared