diff --git a/src/java/org/apache/commons/math/ode/events/CombinedEventsManager.java b/src/java/org/apache/commons/math/ode/events/CombinedEventsManager.java index 43c433e1c..61e1e5c0b 100644 --- a/src/java/org/apache/commons/math/ode/events/CombinedEventsManager.java +++ b/src/java/org/apache/commons/math/ode/events/CombinedEventsManager.java @@ -73,13 +73,14 @@ public class CombinedEventsManager implements Serializable { public void addEventHandler(final EventHandler handler, final double maxCheckInterval, final double convergence, final int maxIterationCount) { states.add(new EventState(handler, maxCheckInterval, - convergence, maxIterationCount)); + convergence, maxIterationCount)); } /** Get all the events handlers that have been added to the manager. * @return an unmodifiable collection of the added event handlers * @see #addEventHandler(EventHandler, double, double, int) * @see #clearEventsHandlers() + * @see #getEventStates() */ public Collection getEventsHandlers() { final List list = new ArrayList(); @@ -97,6 +98,14 @@ public class CombinedEventsManager implements Serializable { states.clear(); } + /** Get all the events state wrapping the handlers that have been added to the manager. + * @return a collection of the events states + * @see #getEventHandlers() + */ + public Collection getEventsStates() { + return states; + } + /** Check if the manager does not manage any event handlers. * @return true if manager is empty */ diff --git a/src/java/org/apache/commons/math/ode/events/EventState.java b/src/java/org/apache/commons/math/ode/events/EventState.java index 39224ccb1..ae138cceb 100644 --- a/src/java/org/apache/commons/math/ode/events/EventState.java +++ b/src/java/org/apache/commons/math/ode/events/EventState.java @@ -41,10 +41,10 @@ import org.apache.commons.math.ode.sampling.StepInterpolator; * @version $Revision$ $Date$ * @since 1.2 */ -class EventState implements Serializable { +public class EventState implements Serializable { /** Serializable version identifier. */ - private static final long serialVersionUID = -7307007422156119622L; + private static final long serialVersionUID = -216176055159247559L; /** Event handler. */ private final EventHandler handler; @@ -119,6 +119,27 @@ class EventState implements Serializable { return handler; } + /** Get the maximal time interval between events handler checks. + * @return maximal time interval between events handler checks + */ + public double getMaxCheckInterval() { + return maxCheckInterval; + } + + /** Get the convergence threshold for event localization. + * @return convergence threshold for event localization + */ + public double getConvergence() { + return convergence; + } + + /** Get the upper limit in the iteration count for event localization. + * @return upper limit in the iteration count for event localization + */ + public int getMaxIterationCount() { + return maxIterationCount; + } + /** Reinitialize the beginning of the step. * @param t0 value of the independent time variable at the * beginning of the step