Class FieldCountingHandler<T extends CalculusFieldElement<T>>
- java.lang.Object
-
- org.orekit.propagation.events.handlers.FieldCountingHandler<T>
-
- All Implemented Interfaces:
FieldEventHandler<T>
- Direct Known Subclasses:
FieldCountAndContinue
public abstract class FieldCountingHandler<T extends CalculusFieldElement<T>> extends Object implements FieldEventHandler<T>
Abstract class for handlers counting event occurrences. TheAction
can be modified according to the count.- Since:
- 13.0
- Author:
- Romain Serra
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FieldCountingHandler(int startingCount, Action action)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract boolean
doesCount(FieldSpacecraftState<T> state, FieldEventDetector<T> detector, boolean increasing)
Method returning true if and only if the count needs to be incremented.Action
eventOccurred(FieldSpacecraftState<T> s, FieldEventDetector<T> detector, boolean increasing)
Handle an event.protected Action
getAction()
Protected getter for the action to return.int
getCount()
Getter for count.protected void
increment()
Increment count.void
reset()
Reset count.protected void
setAction(Action action)
Protected setter for action.-
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.FieldEventHandler
finish, init, resetState
-
-
-
-
Constructor Detail
-
FieldCountingHandler
protected FieldCountingHandler(int startingCount, Action action)
Constructor.- Parameters:
startingCount
- value to initialize countaction
- Action to initialize attribute
-
-
Method Detail
-
eventOccurred
public Action eventOccurred(FieldSpacecraftState<T> s, FieldEventDetector<T> detector, boolean increasing)
Handle an event.- Specified by:
eventOccurred
in interfaceFieldEventHandler<T extends CalculusFieldElement<T>>
- 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
-
doesCount
protected abstract boolean doesCount(FieldSpacecraftState<T> state, FieldEventDetector<T> detector, boolean increasing)
Method returning true if and only if the count needs to be incremented.- Parameters:
state
- state at detectiondetector
- detectorincreasing
- flag on direction of event function- Returns:
- flag on counting
-
getCount
public int getCount()
Getter for count.- Returns:
- count
-
getAction
protected Action getAction()
Protected getter for the action to return.- Returns:
- action
-
setAction
protected void setAction(Action action)
Protected setter for action.- Parameters:
action
- new action
-
reset
public void reset()
Reset count.
-
increment
protected void increment()
Increment count.
-
-