xref: /aosp_15_r20/external/apache-commons-math/src/main/java/org/apache/commons/math3/util/IterationListener.java (revision d3fac44428dd0296a04a50c6827e3205b8dbea8a)
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements.  See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License.  You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 package org.apache.commons.math3.util;
18 
19 import java.util.EventListener;
20 
21 /** The listener interface for receiving events occurring in an iterative algorithm. */
22 public interface IterationListener extends EventListener {
23     /**
24      * Invoked after completion of the initial phase of the iterative algorithm (prior to the main
25      * iteration loop).
26      *
27      * @param e The {@link IterationEvent} object.
28      */
initializationPerformed(IterationEvent e)29     void initializationPerformed(IterationEvent e);
30 
31     /**
32      * Invoked each time an iteration is completed (in the main iteration loop).
33      *
34      * @param e The {@link IterationEvent} object.
35      */
iterationPerformed(IterationEvent e)36     void iterationPerformed(IterationEvent e);
37 
38     /**
39      * Invoked each time a new iteration is completed (in the main iteration loop).
40      *
41      * @param e The {@link IterationEvent} object.
42      */
iterationStarted(IterationEvent e)43     void iterationStarted(IterationEvent e);
44 
45     /**
46      * Invoked after completion of the operations which occur after breaking out of the main
47      * iteration loop.
48      *
49      * @param e The {@link IterationEvent} object.
50      */
terminationPerformed(IterationEvent e)51     void terminationPerformed(IterationEvent e);
52 }
53