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.estimation.measurements;
18
19 /** Class modeling a satellite that can be observed.
20 *
21 * @author Luc Maisonobe
22 * @since 9.3
23 */
24 public class ObservableSatellite extends MeasurementObject {
25
26 /** Prefix for satellite names. */
27 private static final String SAT_PREFIX = "sat-";
28
29 /** Index of the propagator related to this satellite. */
30 private final int propagatorIndex;
31
32 /** Simple constructor.
33 * <p>
34 * This constructor builds a default name based on the propagator index.
35 * </p>
36 * @param propagatorIndex index of the propagator related to this satellite
37 */
38 public ObservableSatellite(final int propagatorIndex) {
39 this(propagatorIndex, null);
40 }
41
42 /** Simple constructor.
43 * @param propagatorIndex index of the propagator related to this satellite
44 * @param name satellite name (if null, a default name built from index will be used)
45 * @since 13.0
46 */
47 public ObservableSatellite(final int propagatorIndex, final String name) {
48 super( name == null ? SAT_PREFIX + propagatorIndex : name );
49 this.propagatorIndex = propagatorIndex;
50 }
51
52 /** Get the index of the propagator related to this satellite.
53 * @return index of the propagator related to this satellite
54 */
55 public int getPropagatorIndex() {
56 return propagatorIndex;
57 }
58
59 /** {@inheritDoc}
60 * @since 12.0
61 */
62 @Override
63 public boolean equals(final Object other) {
64 if (other instanceof ObservableSatellite) {
65 return propagatorIndex == ((ObservableSatellite) other).propagatorIndex;
66 } else {
67 return false;
68
69 }
70 }
71
72 /** {@inheritDoc}
73 * @since 12.0
74 */
75 @Override
76 public int hashCode() {
77 return propagatorIndex;
78 }
79
80 }