StepNormalizerBounds.java

  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.  * This is not the original file distributed by the Apache Software Foundation
  19.  * It has been modified by the Hipparchus project
  20.  */

  21. package org.hipparchus.ode.sampling;

  22. /** {@link StepNormalizer Step normalizer} bounds settings. They influence
  23.  * whether the underlying fixed step size step handler is called for the first
  24.  * and last points. Note that if the last point coincides with a normalized
  25.  * point, then the underlying fixed step size step handler is always called,
  26.  * regardless of these settings.
  27.  * @see FieldStepNormalizer
  28.  * @see StepNormalizer
  29.  * @see StepNormalizerMode
  30.  */
  31. public enum StepNormalizerBounds {
  32.     /** Do not include the first and last points. */
  33.     NEITHER(false, false),

  34.     /** Include the first point, but not the last point. */
  35.     FIRST(true, false),

  36.     /** Include the last point, but not the first point. */
  37.     LAST(false, true),

  38.     /** Include both the first and last points. */
  39.     BOTH(true, true);

  40.     /** Whether the first point should be passed to the underlying fixed
  41.      * step size step handler.
  42.      */
  43.     private final boolean first;

  44.     /** Whether the last point should be passed to the underlying fixed
  45.      * step size step handler.
  46.      */
  47.     private final boolean last;

  48.     /**
  49.      * Simple constructor.
  50.      * @param first Whether the first point should be passed to the
  51.      * underlying fixed step size step handler.
  52.      * @param last Whether the last point should be passed to the
  53.      * underlying fixed step size step handler.
  54.      */
  55.     StepNormalizerBounds(final boolean first, final boolean last) {
  56.         this.first = first;
  57.         this.last = last;
  58.     }

  59.     /**
  60.      * Returns a value indicating whether the first point should be passed
  61.      * to the underlying fixed step size step handler.
  62.      * @return value indicating whether the first point should be passed
  63.      * to the underlying fixed step size step handler.
  64.      */
  65.     public boolean firstIncluded() {
  66.         return first;
  67.     }

  68.     /**
  69.      * Returns a value indicating whether the last point should be passed
  70.      * to the underlying fixed step size step handler.
  71.      * @return value indicating whether the last point should be passed
  72.      * to the underlying fixed step size step handler.
  73.      */
  74.     public boolean lastIncluded() {
  75.         return last;
  76.     }
  77. }