com.rubecula.darwin.examples.pepperedmoth
Enum WingColor

java.lang.Object
  extended by java.lang.Enum<WingColor>
      extended by com.rubecula.darwin.examples.pepperedmoth.WingColor
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<WingColor>

public enum WingColor
extends java.lang.Enum<WingColor>

An enumerated type for the Peppered Moth wing color. There are only two values: Typica (the light phase) and Carbonaria (the dark phase). However, for completeness, and/or testing, we also define two other colors: White and Black, in addition to the Undefined color. Each has a soot density which it matches best (called sootEquivalent()).

Author:
Robin Hillyard

Enum Constant Summary
Black
          soot: 1.0
Carbonaria
          soot: 0.7
Typica
          soot: 0.3
Undefined
           
White
          soot: 0
 
Field Summary
static java.lang.String ID
          TODO consider making this text language-specific
 
Method Summary
static WingColor valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static WingColor[] 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

White

public static final WingColor White
soot: 0


Typica

public static final WingColor Typica
soot: 0.3


Carbonaria

public static final WingColor Carbonaria
soot: 0.7


Black

public static final WingColor Black
soot: 1.0


Undefined

public static final WingColor Undefined
Field Detail

ID

public static final java.lang.String ID
TODO consider making this text language-specific

See Also:
Constant Field Values
Method Detail

values

public static WingColor[] 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 (WingColor c : WingColor.values())
    System.out.println(c);

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

valueOf

public static WingColor 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


Copyright © 2010 Rubecula Software, LLC. All Rights Reserved.