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 * https://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 18 /* 19 * This is not the original file distributed by the Apache Software Foundation 20 * It has been modified by the Hipparchus project 21 */ 22 23 package org.hipparchus.migration.ode.sampling; 24 25 import org.hipparchus.ode.sampling.ODEStateInterpolator; 26 import org.hipparchus.ode.sampling.ODEStepHandler; 27 28 /** 29 * This class is a step handler that does nothing. 30 31 * <p>This class is provided as a convenience for users who are only 32 * interested in the final state of an integration and not in the 33 * intermediate steps. Its handleStep method does nothing.</p> 34 * 35 * <p>Since this class has no internal state, it is implemented using 36 * the Singleton design pattern. This means that only one instance is 37 * ever created, which can be retrieved using the getInstance 38 * method. This explains why there is no public constructor.</p> 39 * 40 * @deprecated as of 1.0, this class is not used anymore 41 */ 42 @Deprecated 43 public class DummyStepHandler implements ODEStepHandler { 44 45 /** Private constructor. 46 * The constructor is private to prevent users from creating 47 * instances (Singleton design-pattern). 48 */ 49 private DummyStepHandler() { 50 } 51 52 /** Get the only instance. 53 * @return the only instance 54 */ 55 public static DummyStepHandler getInstance() { 56 return LazyHolder.INSTANCE; 57 } 58 59 /** {@inheritDoc} */ 60 @Override 61 public void handleStep(final ODEStateInterpolator interpolator) { 62 } 63 64 // CHECKSTYLE: stop HideUtilityClassConstructor 65 /** Holder for the instance. 66 * <p>We use here the Initialization On Demand Holder Idiom.</p> 67 */ 68 private static class LazyHolder { 69 /** Cached field instance. */ 70 private static final DummyStepHandler INSTANCE = new DummyStepHandler(); 71 } 72 // CHECKSTYLE: resume HideUtilityClassConstructor 73 74 /** Handle deserialization of the singleton. 75 * @return the singleton instance 76 */ 77 private Object readResolve() { 78 // return the singleton instance 79 return LazyHolder.INSTANCE; 80 } 81 82 }