Package mars.venus.execute
Enum Class ProgramStatus
- All Implemented Interfaces:
Serializable
,Comparable<ProgramStatus>
,Constable
Enumeration to indicate the status of the current program (which may involve more than one file).
These status values were originally part of
FileStatus
, but were split off to eliminate
unnecessary global state in the class.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe program has yet to be assembled.The program has just been assembled successfully, and is runnable.The program stopped execution after starting, but is still runnable.The program is currently being executed by the simulator.The program stopped execution after starting, and is no longer runnable. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canStart()
Determine whether the program is able to start, but is not currently running.boolean
Determine whether the program has been previously started, but is not currently running.boolean
Determine whether the program is able to run, but is not currently running.static ProgramStatus
Returns the enum constant of this class with the specified name.static ProgramStatus[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NOT_ASSEMBLED
The program has yet to be assembled. -
NOT_STARTED
The program has just been assembled successfully, and is runnable. -
RUNNING
The program is currently being executed by the simulator. -
PAUSED
The program stopped execution after starting, but is still runnable. -
TERMINATED
The program stopped execution after starting, and is no longer runnable.
-
-
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
-
hasStarted
public boolean hasStarted()Determine whether the program has been previously started, but is not currently running.- Returns:
true
if the program isPAUSED
orTERMINATED
, orfalse
otherwise.
-
canStart
public boolean canStart()Determine whether the program is able to start, but is not currently running.- Returns:
true
if the program isNOT_STARTED
orPAUSED
, orfalse
otherwise.
-
isRunnable
public boolean isRunnable()Determine whether the program is able to run, but is not currently running.- Returns:
true
if the program isNOT_STARTED
,PAUSED
, orTERMINATED
, orfalse
otherwise.
-