1   /* Copyright 2022-2025 Luc Maisonobe
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  
18  package org.orekit.files.ccsds.ndm.adm.acm;
19  
20  import java.util.Collections;
21  import java.util.List;
22  
23  import org.orekit.files.general.AttitudeEphemerisFile;
24  import org.orekit.time.AbsoluteDate;
25  import org.orekit.utils.TimeStampedAngularCoordinates;
26  
27  /** ACM ephemeris blocks for a single satellite.
28   * @author Luc Maisonobe
29   * @since 11.0
30   */
31  public class AcmSatelliteEphemeris
32      implements AttitudeEphemerisFile.SatelliteAttitudeEphemeris<TimeStampedAngularCoordinates, AttitudeStateHistory> {
33  
34      /** Name of the object. */
35      private final String name;
36  
37      /** The ephemeris data for the satellite. */
38      private final List<AttitudeStateHistory> blocks;
39  
40      /**
41       * Create a container for the set of ephemeris blocks in the file that pertain to
42       * a single satellite.
43       *
44       * @param name name of the object.
45       * @param blocks containing ephemeris data for the satellite.
46       */
47      public AcmSatelliteEphemeris(final String name, final List<AttitudeStateHistory> blocks) {
48          this.name   = name;
49          this.blocks = blocks;
50      }
51  
52      /** {@inheritDoc} */
53      @Override
54      public String getId() {
55          return name;
56      }
57  
58      /** {@inheritDoc} */
59      @Override
60      public List<AttitudeStateHistory> getSegments() {
61          return Collections.unmodifiableList(blocks);
62      }
63  
64      /** {@inheritDoc} */
65      @Override
66      public AbsoluteDate getStart() {
67          return blocks.get(0).getStart();
68      }
69  
70      /** {@inheritDoc} */
71      @Override
72      public AbsoluteDate getStop() {
73          return blocks.get(blocks.size() - 1).getStop();
74      }
75  
76  }