Enum Class Sex
- All Implemented Interfaces:
Serializable
,Comparable<Sex>
,Constable
Enumerated type for the male/female thing.
- Author:
- maartenl
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic Sex
createFromString
(String aString) Little factory method for creating a Sex object.direct()
returns either "he" or "she"Direct()
returns either "He" or "She"indirect()
returns either "him" or "her"returns either "his" or "her"toString()
returns either "male" or "female"static Sex
Returns the enum constant of this class with the specified name.static Sex[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MALE
-
FEMALE
-
OTHER
Also known as gender-neutral or third gender or non-binary gender. Just pick one.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
createFromString
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
-
posession
-
indirect
-
direct
-
Direct
-