Enum DelpAnswer.Type
- All Implemented Interfaces:
Serializable,Comparable<DelpAnswer.Type>,Constable
- Enclosing class:
- DelpAnswer
The `Type` enum represents the possible types of answers: `YES`, `NO`, `UNDECIDED`, and `UNKNOWN`.
Each type has an associated textual description.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRepresents a negative answer.Represents an undecided answer, indicating that the reasoner cannot determine a clear yes or no.Represents an unknown answer, typically used when the state of the answer is indeterminate or unclassified.Represents an affirmative answer. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the boolean representation of the answer type.Returns the `Double` representation of the answer type.toString()Returns the textual description of the answer type.static DelpAnswer.TypeReturns the enum constant of this type with the specified name.static DelpAnswer.Type[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
-
Enum Constant Details
-
YES
Represents an affirmative answer. -
NO
Represents a negative answer. -
UNDECIDED
Represents an undecided answer, indicating that the reasoner cannot determine a clear yes or no. -
UNKNOWN
Represents an unknown answer, typically used when the state of the answer is indeterminate or unclassified.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
toString
Returns the textual description of the answer type.- Overrides:
toStringin classEnum<DelpAnswer.Type>- Returns:
- the textual description of the answer type.
-
getBooleanAnswer
public boolean getBooleanAnswer()Returns the boolean representation of the answer type.- Returns:
- `true` if the type is `YES`, otherwise `false`.
-
getDoubleAnswer
Returns the `Double` representation of the answer type.- Returns:
- `0d` for `YES`, `-1d` for `NO`, `1d` for `UNDECIDED`, and `Double.NaN` for `UNKNOWN`.
- Throws:
IllegalStateException- if the type cannot be converted to a `Double`.
-