View Javadoc
1   /*
2    * Copyright (C) 2018 Alberto Irurueta Carro (alberto@irurueta.com)
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *         http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package com.irurueta.navigation.geodesic;
17  
18  /**
19   * A pair of double precision numbers.
20   * This is like C++ class {@code std::pair<double, double>}.
21   */
22  public class Pair {
23  
24      /**
25       * The first member of the pair.
26       */
27      private double first;
28  
29      /**
30       * The second member of the pair.
31       */
32      private double second;
33  
34      /**
35       * Constructor.
36       *
37       * @param first  the first member of the pair.
38       * @param second the second member of the pair.
39       */
40      public Pair(final double first, final double second) {
41          this.first = first;
42          this.second = second;
43      }
44  
45      /**
46       * Gets the first member of the pair.
47       *
48       * @return first member of the pair.
49       */
50      public double getFirst() {
51          return first;
52      }
53  
54      /**
55       * Sets the first member of the pair.
56       *
57       * @param first first member of the pair.
58       */
59      public void setFirst(final double first) {
60          this.first = first;
61      }
62  
63      /**
64       * Gets the second member of the pair.
65       *
66       * @return second member of the pair.
67       */
68      public double getSecond() {
69          return second;
70      }
71  
72      /**
73       * Sets the second member of the pair.
74       *
75       * @param second second member of the pair.
76       */
77      public void setSecond(final double second) {
78          this.second = second;
79      }
80  }