scheduler.model
Enum Medication.Special

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

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

Enumerated special options for the description of a medication.


Enum Constant Summary
AFTER_MEAL
           
BEFORE_BED
           
BEFORE_MEAL
           
EMPTY_STOMACH
           
NONE
           
WITH_FOOD
           
WITH_WATER
           
 
Method Summary
 int getNum()
          Returns the number associated with this special.
static Medication.Special getSpecialFromInt(int i)
          Returns the Special pertaining to the specified integer.
static Medication.Special valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Medication.Special[] 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.Special NONE

WITH_FOOD

public static final Medication.Special WITH_FOOD

BEFORE_MEAL

public static final Medication.Special BEFORE_MEAL

AFTER_MEAL

public static final Medication.Special AFTER_MEAL

WITH_WATER

public static final Medication.Special WITH_WATER

EMPTY_STOMACH

public static final Medication.Special EMPTY_STOMACH

BEFORE_BED

public static final Medication.Special BEFORE_BED
Method Detail

values

public static Medication.Special[] 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.Special c : Medication.Special.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.Special 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 special.

Returns:
an integer uniquely identifying the special

getSpecialFromInt

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

Parameters:
i - the integer representation of a special
Returns:
the Special corresponding to i