Package mars.simulator
Class SimulatorFinishEvent
java.lang.Object
java.util.EventObject
mars.simulator.SimulatorFinishEvent
- All Implemented Interfaces:
Serializable
Event for when the simulator stops execution of a program due to termination or finishing.
Note that the return value of
EventObject.getSource()
will always be a Simulator
.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumeration of reasons for why the simulator might finish or terminate. -
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorsConstructorDescriptionSimulatorFinishEvent
(Simulator simulator, SimulatorFinishEvent.Reason reason, SimulatorException exception) Construct a new event with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionThe exception causing the program to terminate (only applies toSimulatorFinishEvent.Reason.EXCEPTION
).The reason why the program finished or terminated.Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
SimulatorFinishEvent
public SimulatorFinishEvent(Simulator simulator, SimulatorFinishEvent.Reason reason, SimulatorException exception) Construct a new event with the given parameters.- Parameters:
simulator
- The source of this event.reason
- The reason why the program finished or terminated.exception
- The exception causing the program to terminate (only applies toSimulatorFinishEvent.Reason.EXCEPTION
).
-
-
Method Details
-
getReason
The reason why the program finished or terminated. -
getException
The exception causing the program to terminate (only applies toSimulatorFinishEvent.Reason.EXCEPTION
).
-