ClockOffset.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. /** Container for time stamped clock offset.
  19.  * @author Luc Maisonobe
  20.  * @since 12.1
  21.  */
  22. public class ClockOffset implements TimeStamped {

  23.     /** Date. */
  24.     private final AbsoluteDate date;

  25.     /** Clock offset. */
  26.     private final double offset;

  27.     /** Clock rate. */
  28.     private final double rate;

  29.     /** Clock acceleration. */
  30.     private final double acceleration;

  31.     /** Simple constructor.
  32.      * @param date   date
  33.      * @param offset clock offset
  34.      * @param rate   clock rate (can be set to {@code Double.NaN} if unknown)
  35.      * @param acceleration clock acceleration (can be set to {@code Double.NaN} if unknown)
  36.      */
  37.     public ClockOffset(final AbsoluteDate date, final double offset,
  38.                        final double rate, final double acceleration) {
  39.         this.date         = date;
  40.         this.offset       = offset;
  41.         this.rate         = rate;
  42.         this.acceleration = acceleration;
  43.     }

  44.     /** {@inheritDoc} */
  45.     @Override
  46.     public AbsoluteDate getDate() {
  47.         return date;
  48.     }

  49.     /** Get offset.
  50.      * @return offset
  51.      */
  52.     public double getOffset() {
  53.         return offset;
  54.     }

  55.     /** Get rate.
  56.      * @return rate ({@code Double.NaN} if unknown)
  57.      */
  58.     public double getRate() {
  59.         return rate;
  60.     }

  61.     /** Get acceleration.
  62.      * @return acceleration ({@code Double.NaN} if unknown)
  63.      */
  64.     public double getAcceleration() {
  65.         return acceleration;
  66.     }

  67. }