Class CountingHandler
java.lang.Object
org.orekit.propagation.events.handlers.CountingHandler
- All Implemented Interfaces:
EventHandler
Class for handlers counting event occurrences. The
Action can be modified according to the count.- Since:
- 13.0
- Author:
- Romain Serra
-
Constructor Summary
ConstructorsConstructorDescriptionCountingHandler(int startingCount, Action action) Constructor.CountingHandler(Action action) Constructor with initial count at zero. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleandoesCount(SpacecraftState state, EventDetector detector, boolean increasing) Method returning true if and only if the count needs to be incremented.eventOccurred(SpacecraftState s, EventDetector detector, boolean increasing) Handle an event.protected ActionProtected getter for the action to return.intgetCount()Getter for count.protected voidIncrement count.voidreset()Reset count.protected voidProtected setter for action.voidsetCount(int count) Reset count.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.orekit.propagation.events.handlers.EventHandler
finish, init, resetState
-
Constructor Details
-
CountingHandler
Constructor with initial count at zero.- Parameters:
action- Action to initialize attribute
-
CountingHandler
Constructor.- Parameters:
startingCount- value to initialize countaction- Action to initialize attribute
-
-
Method Details
-
eventOccurred
Handle an event.- Specified by:
eventOccurredin interfaceEventHandler- 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
Method returning true if and only if the count needs to be incremented. By default, count all.- 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 getter for the action to return.- Returns:
- action
-
setAction
Protected setter for action.- Parameters:
action- new action
-
setCount
public void setCount(int count) Reset count.- Parameters:
count- new value
-
reset
public void reset()Reset count. -
increment
protected void increment()Increment count.
-