View Javadoc
1   package org.opentrafficsim.base.parameters;
2   
3   import java.io.Serializable;
4   
5   import org.djunits.value.vdouble.scalar.Length;
6   import org.opentrafficsim.base.parameters.constraint.Constraint;
7   
8   /**
9    * Wrapper class for Length 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 ParameterTypeLength extends ParameterTypeNumeric<Length> implements Serializable
19  {
20  
21      /** */
22      private static final long serialVersionUID = 20160400L;
23  
24      /**
25       * Constructor without default value and check.
26       * @param id String; short name of the new ParameterTypeLength
27       * @param description String; parameter description or full name of the new ParameterTypeLength
28       */
29      public ParameterTypeLength(final String id, final String description)
30      {
31          super(id, description, Length.class);
32      }
33  
34      /**
35       * Construct a new ParameterTypeLength with default value, without check.
36       * @param id String; short name of the new ParameterTypeLength
37       * @param description String; parameter description or full name of the new ParameterTypeLength
38       * @param defaultValue Length; the default value of the new ParameterTypeLength
39       */
40      public ParameterTypeLength(final String id, final String description, final Length defaultValue)
41      {
42          super(id, description, Length.class, defaultValue);
43      }
44  
45      /**
46       * Construct a new ParameterTypeLength without default value, with check.
47       * @param id String; short name of the new ParameterTypeLength
48       * @param description String; parameter description or full name of the new ParameterTypeLength
49       * @param constraint Constraint&lt;? super Length&gt;; constraint for parameter values
50       */
51      public ParameterTypeLength(final String id, final String description, final Constraint<? super Length> constraint)
52      {
53          super(id, description, Length.class, constraint);
54      }
55  
56      /**
57       * Construct a new ParameterTypeLength with default value and check.
58       * @param id String; short name of the new ParameterTypeLength
59       * @param description String; parameter description or full name of the new ParameterTypeLength
60       * @param defaultValue Length; the default value of the new ParameterTypeLength
61       * @param constraint Constraint&lt;? super Length&gt;; constraint for parameter values
62       */
63      public ParameterTypeLength(final String id, final String description, final Length defaultValue,
64              final Constraint<? super Length> constraint)
65      {
66          super(id, description, Length.class, defaultValue, constraint);
67      }
68  
69      /** {@inheritDoc} */
70      @Override
71      public final String toString()
72      {
73          return "ParameterTypeLength [id=" + getId() + ", description=" + getDescription() + "]";
74      }
75  
76  }