T
- the type of EventDetector
that this event handler will
handle events for.EventHandler<T>
public class RecordAndContinue<T extends EventDetector> extends Object implements EventHandler<T>
EventHandler.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.
Modifier and Type | Class | Description |
---|---|---|
static class |
RecordAndContinue.Event<T> |
A single event detected during propagation.
|
EventHandler.Action
Constructor | Description |
---|---|
RecordAndContinue() |
Create a new handler using an
ArrayList to store events. |
RecordAndContinue(List<RecordAndContinue.Event<T>> events) |
Create a handler using the given collection to store events.
|
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 in
EventDetector
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.
|
init
public RecordAndContinue()
ArrayList
to store events.public RecordAndContinue(List<RecordAndContinue.Event<T>> events)
events
- collection.public List<RecordAndContinue.Event<T>> getEvents()
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.
public void clear()
public EventHandler.Action eventOccurred(SpacecraftState s, T detector, boolean increasing)
EventHandler
EventDetector
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.eventOccurred
in interface EventHandler<T extends EventDetector>
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 directionpublic SpacecraftState resetState(T detector, SpacecraftState oldState)
EventHandler
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 the EventHandler.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 the
EventHandler.eventOccurred(org.orekit.propagation.SpacecraftState, T, boolean)
never returns the EventHandler.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.
resetState
in interface EventHandler<T extends EventDetector>
detector
- object with appropriate type that can be used in determining correct return stateoldState
- old stateCopyright © 2002-2018 CS Systèmes d'information. All rights reserved.