1   /* Copyright 2002-2025 CS GROUP
2    * Licensed to CS GROUP (CS) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * CS 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.orekit.time;
18  
19  import java.util.Collection;
20  import java.util.List;
21  import java.util.stream.Stream;
22  
23  /**
24   * This interface represents objects that can interpolate a time stamped value with respect to time.
25   *
26   * @param <T> type of the interpolated instance
27   *
28   * @author Vincent Cucchietti
29   * @see AbsoluteDate
30   * @see TimeStamped
31   */
32  public interface TimeInterpolator<T extends TimeStamped> {
33  
34      /**
35       * Get an interpolated instance.
36       *
37       * @param interpolationDate interpolation date
38       * @param sample time stamped sample
39       *
40       * @return a new instance, interpolated at specified date
41       *
42       * @see TimeStamped
43       * @see AbsoluteDate
44       */
45      T interpolate(AbsoluteDate interpolationDate, Stream<T> sample);
46  
47      /**
48       * Get an interpolated instance.
49       *
50       * @param interpolationDate interpolation date
51       * @param sample time stamped sample
52       *
53       * @return a new instance, interpolated at specified date
54       */
55      T interpolate(AbsoluteDate interpolationDate, Collection<T> sample);
56  
57      /**
58       * Get all lowest level interpolators implemented by this instance, otherwise return a list with this instance only.
59       * <p>
60       * An example would be the spacecraft state interpolator which can use different interpolators for each of its attributes
61       * (orbit, absolute position-velocity-acceleration coordinates, mass...). In this case, it would return the list of all
62       * of these interpolators (or possibly all of their sub-interpolators if they were to use multiple interpolators
63       * themselves).
64       *
65       * @return list of interpolators
66       */
67      List<TimeInterpolator<? extends TimeStamped>> getSubInterpolators();
68  
69      /**
70       * Get the number of interpolation points. In the specific case where this interpolator contains multiple
71       * sub-interpolators, this method will return the maximum number of interpolation points required among all
72       * sub-interpolators.
73       *
74       * @return the number of interpolation points
75       *
76       * @since 12.0.1
77       */
78      int getNbInterpolationPoints();
79  
80      /** Get the extrapolation threshold.
81       * @return get the extrapolation threshold
82       */
83      double getExtrapolationThreshold();
84  }