scheduler.model
Enum Medication.Color

java.lang.Object
  extended by java.lang.Enum<Medication.Color>
      extended by scheduler.model.Medication.Color
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Medication.Color>
Enclosing class:
Medication

public static enum Medication.Color
extends java.lang.Enum<Medication.Color>

Enumerated color options for the description of a medication.


Enum Constant Summary
BLUE
           
GREEN
           
NONE
           
ORANGE
           
PINK
           
PURPLE
           
RED
           
YELLOW
           
 
Method Summary
static Medication.Color getColorFromInt(int i)
          Returns the Color pertaining to the specified integer.
 int getNum()
          Returns the number associated with this color.
static Medication.Color valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Medication.Color[] 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

NONE

public static final Medication.Color NONE

RED

public static final Medication.Color RED

ORANGE

public static final Medication.Color ORANGE

YELLOW

public static final Medication.Color YELLOW

GREEN

public static final Medication.Color GREEN

BLUE

public static final Medication.Color BLUE

PINK

public static final Medication.Color PINK

PURPLE

public static final Medication.Color PURPLE
Method Detail

values

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

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

valueOf

public static Medication.Color 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

getNum

public int getNum()
Returns the number associated with this color.

Returns:
an integer uniquely identifying the color

getColorFromInt

public static Medication.Color getColorFromInt(int i)
Returns the Color pertaining to the specified integer. Returns Color.NONE if the integer has no matches.

Parameters:
i - the integer representation of a color
Returns:
the Color corresponding to i