SourceTable.java

  1. /* Copyright 2002-2021 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.gnss.metric.ntrip;

  18. import java.util.ArrayList;
  19. import java.util.List;

  20. /** Source table for ntrip streams retrieval.
  21.  * @author Luc Maisonobe
  22.  * @since 11.0
  23.  */
  24. public class SourceTable {

  25.     /** Flags set by server. */
  26.     private final String ntripFlags;

  27.     /** Casters records. */
  28.     private final List<CasterRecord> casters;

  29.     /** Networks records. */
  30.     private final List<NetworkRecord> networks;

  31.     /** Data stream records. */
  32.     private final List<DataStreamRecord> dataStreams;

  33.     /** Build a source table by parsing all records.
  34.      * @param ntripFlags flags set by the server
  35.      */
  36.     SourceTable(final String ntripFlags) {
  37.         this.ntripFlags   = ntripFlags;
  38.         this.casters      = new ArrayList<>();
  39.         this.networks     = new ArrayList<>();
  40.         this.dataStreams  = new ArrayList<>();
  41.     }

  42.     /** Add a caster record.
  43.      * @param caster caster record to add
  44.      */
  45.     void addCasterRecord(final CasterRecord caster) {
  46.         casters.add(caster);
  47.     }

  48.     /** Add a network record.
  49.      * @param network network record to add
  50.      */
  51.     void addNetworkRecord(final NetworkRecord network) {
  52.         networks.add(network);
  53.     }

  54.     /** Add a data stream record.
  55.      * @param dataStream data stream record to add
  56.      */
  57.     void addDataStreamRecord(final DataStreamRecord dataStream) {
  58.         dataStreams.add(dataStream);
  59.     }

  60.     /** Get the flags set by server.
  61.      * @return flags set by server
  62.      */
  63.     public String getNtripFlags() {
  64.         return ntripFlags;
  65.     }

  66.     /** Get the casters records.
  67.      * @return casters records
  68.      */
  69.     public List<CasterRecord> getCasters() {
  70.         return casters;
  71.     }

  72.     /** Get the networks records.
  73.      * @return networks records
  74.      */
  75.     public List<NetworkRecord> getNetworks() {
  76.         return networks;
  77.     }

  78.     /** Get the data streams records.
  79.      * @return data streams records
  80.      */
  81.     public List<DataStreamRecord> getDataStreams() {
  82.         return dataStreams;
  83.     }

  84. }