added a way to retrieve the meta-data associated with event handlers

(max iteration count, convergence, check interval)

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/branches/MATH_2_0@673752 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2008-07-03 18:29:32 +00:00
parent 84e30a013d
commit 3fdd549c50
2 changed files with 33 additions and 3 deletions

View File

@ -80,6 +80,7 @@ public class CombinedEventsManager implements Serializable {
* @return an unmodifiable collection of the added event handlers * @return an unmodifiable collection of the added event handlers
* @see #addEventHandler(EventHandler, double, double, int) * @see #addEventHandler(EventHandler, double, double, int)
* @see #clearEventsHandlers() * @see #clearEventsHandlers()
* @see #getEventStates()
*/ */
public Collection<EventHandler> getEventsHandlers() { public Collection<EventHandler> getEventsHandlers() {
final List<EventHandler> list = new ArrayList<EventHandler>(); final List<EventHandler> list = new ArrayList<EventHandler>();
@ -97,6 +98,14 @@ public class CombinedEventsManager implements Serializable {
states.clear(); 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<EventState> getEventsStates() {
return states;
}
/** Check if the manager does not manage any event handlers. /** Check if the manager does not manage any event handlers.
* @return true if manager is empty * @return true if manager is empty
*/ */

View File

@ -41,10 +41,10 @@ import org.apache.commons.math.ode.sampling.StepInterpolator;
* @version $Revision$ $Date$ * @version $Revision$ $Date$
* @since 1.2 * @since 1.2
*/ */
class EventState implements Serializable { public class EventState implements Serializable {
/** Serializable version identifier. */ /** Serializable version identifier. */
private static final long serialVersionUID = -7307007422156119622L; private static final long serialVersionUID = -216176055159247559L;
/** Event handler. */ /** Event handler. */
private final EventHandler handler; private final EventHandler handler;
@ -119,6 +119,27 @@ class EventState implements Serializable {
return handler; 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. /** Reinitialize the beginning of the step.
* @param t0 value of the independent <i>time</i> variable at the * @param t0 value of the independent <i>time</i> variable at the
* beginning of the step * beginning of the step