FieldClockOffset.java

  1. /* Copyright 2022-2025 Thales Alenia Space
  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. import org.hipparchus.CalculusFieldElement;

  19. /** Container for time stamped clock offset.
  20.  * @param <T> type of the field elements
  21.  * @author Luc Maisonobe
  22.  * @since 12.1
  23.  */
  24. public class FieldClockOffset<T extends CalculusFieldElement<T>> implements FieldTimeStamped<T> {

  25.     /** Date. */
  26.     private final FieldAbsoluteDate<T> date;

  27.     /** Clock offset. */
  28.     private final T offset;

  29.     /** Clock rate. */
  30.     private final T rate;

  31.     /** Clock acceleration. */
  32.     private final T acceleration;

  33.     /** Simple constructor.
  34.      * @param date   date
  35.      * @param offset clock offset
  36.      * @param rate   clock rate (can be set to {@code null} if unknown)
  37.      * @param acceleration clock acceleration (can be set to {@code null} if unknown)
  38.      */
  39.     public FieldClockOffset(final FieldAbsoluteDate<T> date, final T offset,
  40.                             final T rate, final T acceleration) {
  41.         this.date         = date;
  42.         this.offset       = offset;
  43.         this.rate         = rate;
  44.         this.acceleration = acceleration;
  45.     }

  46.     /** {@inheritDoc} */
  47.     @Override
  48.     public FieldAbsoluteDate<T> getDate() {
  49.         return date;
  50.     }

  51.     /** Get offset.
  52.      * @return offset
  53.      */
  54.     public T getOffset() {
  55.         return offset;
  56.     }

  57.     /** Get rate.
  58.      * @return rate ({@code null} if unknown)
  59.      */
  60.     public T getRate() {
  61.         return rate;
  62.     }

  63.     /** Get acceleration.
  64.      * @return acceleration ({@code null} if unknown)
  65.      */
  66.     public T getAcceleration() {
  67.         return acceleration;
  68.     }

  69. }