Package io.github.skenvy
Enum Collatz.SequenceState
- java.lang.Object
-
- java.lang.Enum<Collatz.SequenceState>
-
- io.github.skenvy.Collatz.SequenceState
-
- All Implemented Interfaces:
Serializable
,Comparable<Collatz.SequenceState>
- Enclosing class:
- Collatz
protected static enum Collatz.SequenceState extends Enum<Collatz.SequenceState>
SequenceState for Cycle Control: Descriptive flags to indicate when some event occurs in the hailstone sequences or tree graph reversal, when set to verbose, or stopping time check.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CYCLE_INIT
A Hailstone and TreeGraph sequence state that indicates the first occurence of a value that subsequently forms a cycle.CYCLE_LENGTH
A Hailstone and TreeGraph sequence state that indicates the last occurence of a value that has already formed a cycle.MAX_STOP_OUT_OF_BOUNDS
A Hailstone and TreeGraph sequence state that indicates the sequence or traversal has executed some imposed 'maximum' amount of times.STOPPING_TIME
A Hailstone sequence state that indicates the stopping time, a value less than the initial, has been reached.TOTAL_STOPPING_TIME
A Hailstone sequence state that indicates the total stopping time, a value of 1, has been reached.ZERO_STOP
A Hailstone sequence state that indicates the sequence terminated by reaching "0", a special type of "stopping time".
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getLabel()
Retrieve the sequence state string associated with the enum.static Collatz.SequenceState
valueOf(String name)
Returns the enum constant of this type with the specified name.static Collatz.SequenceState[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
STOPPING_TIME
public static final Collatz.SequenceState STOPPING_TIME
A Hailstone sequence state that indicates the stopping time, a value less than the initial, has been reached.
-
TOTAL_STOPPING_TIME
public static final Collatz.SequenceState TOTAL_STOPPING_TIME
A Hailstone sequence state that indicates the total stopping time, a value of 1, has been reached.
-
CYCLE_INIT
public static final Collatz.SequenceState CYCLE_INIT
A Hailstone and TreeGraph sequence state that indicates the first occurence of a value that subsequently forms a cycle.
-
CYCLE_LENGTH
public static final Collatz.SequenceState CYCLE_LENGTH
A Hailstone and TreeGraph sequence state that indicates the last occurence of a value that has already formed a cycle.
-
MAX_STOP_OUT_OF_BOUNDS
public static final Collatz.SequenceState MAX_STOP_OUT_OF_BOUNDS
A Hailstone and TreeGraph sequence state that indicates the sequence or traversal has executed some imposed 'maximum' amount of times.
-
ZERO_STOP
public static final Collatz.SequenceState ZERO_STOP
A Hailstone sequence state that indicates the sequence terminated by reaching "0", a special type of "stopping time".
-
-
Method Detail
-
values
public static Collatz.SequenceState[] 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 (Collatz.SequenceState c : Collatz.SequenceState.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Collatz.SequenceState valueOf(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getLabel
protected String getLabel()
Retrieve the sequence state string associated with the enum.- Returns:
- The stringy form of the enum.
-
-