VelocityVectorComponentTerm.java

  1. /* Copyright 2024-2025 The Johns Hopkins University Applied Physics Laboratory
  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.files.iirv.terms;

  18. import org.orekit.files.iirv.terms.base.DoubleValuedIIRVTerm;

  19. /**
  20.  * 13-character signed component of a velocity vector.
  21.  * <p>
  22.  * Units: m/s
  23.  * <p>
  24.  * Assumed decimal places is three places from the right
  25.  * <p>
  26.  * Valid values:
  27.  * <ul>
  28.  * <li> Character 1: ' ' or '-'
  29.  * <li> Character 2-12: Any integer 0-9
  30.  * </ul>
  31.  *
  32.  * @author Nick LaFarge
  33.  * @since 13.0
  34.  */
  35. public class VelocityVectorComponentTerm extends DoubleValuedIIRVTerm {

  36.     /** The length of the IIRV term within the message. */
  37.     public static final int VELOCITY_VECTOR_COMPONENT_TERM_LENGTH = 13;

  38.     /** Regular expression that ensures the validity of string values for this term. */
  39.     public static final String VELOCITY_VECTOR_COMPONENT_TERM_PATTERN = "( |-)\\d{12}";

  40.     /** Number of characters before the end of the string the decimal place occurs. */
  41.     public static final int N_CHARS_AFTER_DECIMAL_PLACE = 3;

  42.     /**
  43.      * Constructor.
  44.      * <p>
  45.      * See {@link DoubleValuedIIRVTerm#DoubleValuedIIRVTerm(String, String, int, int, boolean)}
  46.      *
  47.      * @param value value of component of the velocity vector [m/s]
  48.      */
  49.     public VelocityVectorComponentTerm(final String value) {
  50.         super(VELOCITY_VECTOR_COMPONENT_TERM_PATTERN,
  51.             value,
  52.             VELOCITY_VECTOR_COMPONENT_TERM_LENGTH,
  53.             N_CHARS_AFTER_DECIMAL_PLACE,
  54.             true);
  55.     }

  56.     /**
  57.      * Constructor.
  58.      * <p>
  59.      * See {@link DoubleValuedIIRVTerm#DoubleValuedIIRVTerm(String, double, int, int, boolean)}
  60.      *
  61.      * @param value value of component of the velocity vector [m/s]
  62.      */
  63.     public VelocityVectorComponentTerm(final double value) {
  64.         super(VELOCITY_VECTOR_COMPONENT_TERM_PATTERN,
  65.             value,
  66.             VELOCITY_VECTOR_COMPONENT_TERM_LENGTH,
  67.             N_CHARS_AFTER_DECIMAL_PLACE,
  68.             true);
  69.     }

  70. }