View Javadoc
1   package org.opentrafficsim.kpi.sampling.indicator;
2   
3   import org.djunits.value.vdouble.scalar.base.DoubleScalarRel;
4   
5   /**
6    * Wrapper class for two typed values that represent a confidence interval.
7    * <p>
8    * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
9    * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
10   * </p>
11   * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a>
12   * @author <a href="https://tudelft.nl/staff/p.knoppers-1">Peter Knoppers</a>
13   * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
14   * @param <T> type of the values
15   */
16  public class ConfidenceInterval<T extends DoubleScalarRel<?, T>>
17  {
18  
19      /** Lower confidence value. */
20      private final T lowerValue;
21  
22      /** Upper confidence value. */
23      private final T upperValue;
24  
25      /**
26       * @param lowerValue T; lower confidence value
27       * @param upperValue T; upper confidence value
28       */
29      ConfidenceInterval(final T lowerValue, final T upperValue)
30      {
31          this.lowerValue = lowerValue;
32          this.upperValue = upperValue;
33      }
34  
35      /**
36       * @return lowerValue.
37       */
38      public T getLowerValue()
39      {
40          return this.lowerValue;
41      }
42  
43      /**
44       * @return upperValue.
45       */
46      public T getUpperValue()
47      {
48          return this.upperValue;
49      }
50  
51      /** {@inheritDoc} */
52      @Override
53      public final String toString()
54      {
55          return "ConfidenceInterval [lowerValue=" + this.lowerValue + ", upperValue=" + this.upperValue + "]";
56      }
57  
58  }