Class RecordAndContinue<T extends EventDetector>
- java.lang.Object
-
- org.orekit.propagation.events.handlers.RecordAndContinue<T>
-
- Type Parameters:
T
- the type ofEventDetector
that this event handler will handle events for.
- All Implemented Interfaces:
EventHandler<T>
public class RecordAndContinue<T extends EventDetector> extends Object implements EventHandler<T>
Handler that will record every time an event occurs and always returnEventHandler.Action.CONTINUE
.As this handler stores all observed events it may consume large amounts of memory depending on the duration of propagation and the frequency of events.
- Author:
- Evan Ward
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RecordAndContinue.Event<T>
A single event detected during propagation.-
Nested classes/interfaces inherited from interface org.orekit.propagation.events.handlers.EventHandler
EventHandler.Action
-
-
Constructor Summary
Constructors Constructor Description RecordAndContinue()
Create a new handler using anArrayList
to store events.RecordAndContinue(List<RecordAndContinue.Event<T>> events)
Create a handler using the given collection to store events.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear all stored events.EventHandler.Action
eventOccurred(SpacecraftState s, T detector, boolean increasing)
eventOccurred method mirrors the same interface method as inEventDetector
and its subclasses, but with an additional parameter that allows the calling method to pass in an object from the detector which would have potential additional data to allow the implementing class to determine the correct return state.List<RecordAndContinue.Event<T>>
getEvents()
Get the events passed to this handler.SpacecraftState
resetState(T detector, SpacecraftState oldState)
Reset the state prior to continue propagation.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.orekit.propagation.events.handlers.EventHandler
init
-
-
-
-
Constructor Detail
-
RecordAndContinue
public RecordAndContinue()
Create a new handler using anArrayList
to store events.
-
RecordAndContinue
public RecordAndContinue(List<RecordAndContinue.Event<T>> events)
Create a handler using the given collection to store events.- Parameters:
events
- collection.
-
-
Method Detail
-
getEvents
public List<RecordAndContinue.Event<T>> getEvents()
Get the events passed to this handler.Note the returned list of events is in the order the events were passed to this handler by calling
eventOccurred(SpacecraftState, EventDetector, boolean)
. This may or may not be chronological order.Also not that this method returns a view of the internal collection used to store events and calling any of this handler's methods may modify both the underlying collection and the returned view. If a snapshot of the events up to a certain point is needed create a copy of the returned collection.
- Returns:
- the events observed by the handler in the order they were observed.
-
clear
public void clear()
Clear all stored events.
-
eventOccurred
public EventHandler.Action eventOccurred(SpacecraftState s, T detector, boolean increasing)
Description copied from interface:EventHandler
eventOccurred method mirrors the same interface method as inEventDetector
and its subclasses, but with an additional parameter that allows the calling method to pass in an object from the detector which would have potential additional data to allow the implementing class to determine the correct return state.- Specified by:
eventOccurred
in interfaceEventHandler<T extends EventDetector>
- Parameters:
s
- SpaceCraft state to be used in the evaluationdetector
- object with appropriate type that can be used in determining correct return stateincreasing
- with the event occurred in an "increasing" or "decreasing" slope direction- Returns:
- the Action that the calling detector should pass back to the evaluation system
-
resetState
public SpacecraftState resetState(T detector, SpacecraftState oldState)
Description copied from interface:EventHandler
Reset the state prior to continue propagation.This method is called after the step handler has returned and before the next step is started, but only when
EventHandler.eventOccurred(org.orekit.propagation.SpacecraftState, T, boolean)
has itself returned theEventHandler.Action.RESET_STATE
indicator. It allows the user to reset the state for the next step, without perturbing the step handler of the finishing step. If theEventHandler.eventOccurred(org.orekit.propagation.SpacecraftState, T, boolean)
never returns theEventHandler.Action.RESET_STATE
indicator, this function will never be called, and it is safe to simply return null.The default implementation simply return its argument.
- Specified by:
resetState
in interfaceEventHandler<T extends EventDetector>
- Parameters:
detector
- object with appropriate type that can be used in determining correct return stateoldState
- old state- Returns:
- new state
-
-