Enum Class Sex

All Implemented Interfaces:
Serializable, Comparable<Sex>, Constable

public enum Sex extends Enum<Sex>
Enumerated type for the male/female thing.
Author:
maartenl
  • Enum Constant Details

    • MALE

      public static final Sex MALE
    • FEMALE

      public static final Sex FEMALE
    • OTHER

      public static final Sex OTHER
      Also known as gender-neutral or third gender or non-binary gender. Just pick one.
  • Method Details

    • values

      public static Sex[] 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 Sex 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
    • createFromString

      public static Sex createFromString(String aString)
      Little factory method for creating a Sex object.
      Parameters:
      aString - string describing the sex object to be created: "female", "male" or "other".
      Returns:
      Sex object, either male of female or other.
      Throws:
      MudException - if the sex is neither male nor female nor other. In this case we do not know what to do.
    • toString

      public String toString()
      returns either "male" or "female"
      Overrides:
      toString in class Enum<Sex>
      Returns:
      returns either "male" or "female"
    • posession

      public String posession()
      returns either "his" or "her"
      Returns:
      returns either "his" or "her"
    • indirect

      public String indirect()
      returns either "him" or "her"
      Returns:
      returns either "him" or "her"
    • direct

      public String direct()
      returns either "he" or "she"
      Returns:
      returns either "he" or "she"
    • Direct

      public String Direct()
      returns either "He" or "She"
      Returns:
      returns either "He" or "She"
      See Also: