View Javadoc
1   package org.opentrafficsim.base.parameters;
2   
3   import java.io.Serializable;
4   
5   import org.djunits.value.vdouble.scalar.Speed;
6   import org.opentrafficsim.base.parameters.constraint.Constraint;
7   
8   /**
9    * Wrapper class for Speed parameters.
10   * <p>
11   * Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
12   * BSD-style license. See <a href="http://opentrafficsim.org/docs/current/license.html">OpenTrafficSim License</a>.
13   * <p>
14   * @version $Revision$, $LastChangedDate$, by $Author$, initial version Apr 13, 2016 <br>
15   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
16   * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a>
17   */
18  public class ParameterTypeSpeed extends ParameterTypeNumeric<Speed> implements Serializable
19  {
20  
21      /** */
22      private static final long serialVersionUID = 20160400L;
23  
24      /**
25       * Construct a new ParameterTypeSpeed without default value and check.
26       * @param id String; short name of the new ParameterTypeSpeed
27       * @param description String; parameter description or full name of the new ParameterTypeSpeed
28       */
29      public ParameterTypeSpeed(final String id, final String description)
30      {
31          super(id, description, Speed.class);
32      }
33  
34      /**
35       * Construct a new ParameterTypeSpeed with default value, without check.
36       * @param id String; short name of the new ParameterTypeSpeed
37       * @param description String; parameter description or full name of the new ParameterTypeSpeed
38       * @param defaultValue Speed; default value of the new ParameterTypeSpeed
39       */
40      public ParameterTypeSpeed(final String id, final String description, final Speed defaultValue)
41      {
42          super(id, description, Speed.class, defaultValue);
43      }
44  
45      /**
46       * Constructor a new ParameterTypeSpeed without default value, with check.
47       * @param id String; short name of the new ParameterTypeSpeed
48       * @param description String; parameter description or full name of the new ParameterTypeSpeed
49       * @param constraint Constraint&lt;? super Speed&gt;; constraint for parameter values
50       */
51      public ParameterTypeSpeed(final String id, final String description, final Constraint<? super Speed> constraint)
52      {
53          super(id, description, Speed.class, constraint);
54      }
55  
56      /**
57       * Constructor a new ParameterTypeSpeed with default value and check.
58       * @param id String; short name of the new ParameterTypeSpeed
59       * @param description String; parameter description or full name of the new ParameterTypeSpeed
60       * @param defaultValue Speed; default value of the new ParameterTypeSpeed
61       * @param constraint Constraint&lt;? super Speed&gt;; constraint for parameter values
62       */
63      public ParameterTypeSpeed(final String id, final String description, final Speed defaultValue,
64              final Constraint<? super Speed> constraint)
65      {
66          super(id, description, Speed.class, defaultValue, constraint);
67      }
68  
69      /** {@inheritDoc} */
70      @Override
71      public final String toString()
72      {
73          return "ParameterTypeSpeed [id=" + getId() + ", description=" + getDescription() + "]";
74      }
75  
76  }