You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by lu...@apache.org on 2008/07/03 20:29:33 UTC
svn commit: r673752 - in
/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/events:
CombinedEventsManager.java EventState.java
Author: luc
Date: Thu Jul 3 11:29:32 2008
New Revision: 673752
URL: http://svn.apache.org/viewvc?rev=673752&view=rev
Log:
added a way to retrieve the meta-data associated with event handlers
(max iteration count, convergence, check interval)
Modified:
commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/events/CombinedEventsManager.java
commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/events/EventState.java
Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/events/CombinedEventsManager.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/events/CombinedEventsManager.java?rev=673752&r1=673751&r2=673752&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/events/CombinedEventsManager.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/events/CombinedEventsManager.java Thu Jul 3 11:29:32 2008
@@ -73,13 +73,14 @@
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<EventHandler> getEventsHandlers() {
final List<EventHandler> list = new ArrayList<EventHandler>();
@@ -97,6 +98,14 @@
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.
* @return true if manager is empty
*/
Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/events/EventState.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/events/EventState.java?rev=673752&r1=673751&r2=673752&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/events/EventState.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/events/EventState.java Thu Jul 3 11:29:32 2008
@@ -41,10 +41,10 @@
* @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 @@
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 <i>time</i> variable at the
* beginning of the step