Enum Class AnimalLegs

java.lang.Object
java.lang.Enum<AnimalLegs>
edu.nwmissouri.animalList.AnimalLegs
All Implemented Interfaces:
Serializable, Comparable<AnimalLegs>, Constable

public enum AnimalLegs extends Enum<AnimalLegs>
Animal number of leg options Illustrates enumerated types (Java enum with int value) Good for attributes selected from a drop-down list
Author:
Denise Case
  • Enum Constant Details

    • NO_LEGS

      public static final AnimalLegs NO_LEGS
      Animal has no legs / does not apply
    • TWO_LEGS

      public static final AnimalLegs TWO_LEGS
      Animal generally has two legs
    • FOUR_LEGS

      public static final AnimalLegs FOUR_LEGS
      Animal generally has four legs
    • OVER_FOUR_LEGS

      public static final AnimalLegs OVER_FOUR_LEGS
      Animal generally has many legs (more than 4)
  • Method Details

    • values

      public static AnimalLegs[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AnimalLegs valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getStatus

      public int getStatus()