1   /* Copyright 2002-2022 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.estimation.measurements.generation;
18  
19  import org.orekit.estimation.measurements.ObservedMeasurement;
20  import org.orekit.time.AbsoluteDate;
21  import org.orekit.time.DatesSelector;
22  
23  
24  /** Base implementation of {@link Scheduler} managing {@link DatesSelector dates selection}.
25   * @param <T> the type of the measurement
26   * @author Luc Maisonobe
27   * @since 9.3
28   */
29  public abstract class AbstractScheduler<T extends ObservedMeasurement<T>> implements Scheduler<T> {
30  
31      /** Builder for individual measurements. */
32      private final MeasurementBuilder<T> builder;
33  
34      /** Selector for dates. */
35      private final DatesSelector selector;
36  
37      /** Simple constructor.
38       * @param builder builder for individual measurements
39       * @param selector selector for dates
40       */
41      protected AbstractScheduler(final MeasurementBuilder<T> builder,
42                                  final DatesSelector selector) {
43          this.builder  = builder;
44          this.selector = selector;
45      }
46  
47      /** {@inheritDoc}
48       * <p>
49       * This implementation initialize the measurement builder.
50       * </p>
51       */
52      @Override
53      public void init(final AbsoluteDate start, final AbsoluteDate end) {
54          builder.init(start, end);
55      }
56  
57      /** Get the measurements builder.
58       * @return measurements builder
59       */
60      public MeasurementBuilder<T> getBuilder() {
61          return builder;
62      }
63  
64      /** Get the dates selector.
65       * @return dates selector
66       */
67      public DatesSelector getSelector() {
68          return selector;
69      }
70  
71  }