ParameterTypeLength.java

  1. package org.opentrafficsim.base.parameters;

  2. import java.io.Serializable;

  3. import org.djunits.value.vdouble.scalar.Length;
  4. import org.opentrafficsim.base.parameters.constraint.Constraint;

  5. /**
  6.  * Wrapper class for Length parameters.
  7.  * <p>
  8.  * Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
  9.  * BSD-style license. See <a href="http://opentrafficsim.org/docs/current/license.html">OpenTrafficSim License</a>.
  10.  * <p>
  11.  * @version $Revision$, $LastChangedDate$, by $Author$, initial version Apr 13, 2016 <br>
  12.  * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
  13.  * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a>
  14.  */
  15. public class ParameterTypeLength extends ParameterTypeNumeric<Length> implements Serializable
  16. {

  17.     /** */
  18.     private static final long serialVersionUID = 20160400L;

  19.     /**
  20.      * Constructor without default value and check.
  21.      * @param id String; short name of the new ParameterTypeLength
  22.      * @param description String; parameter description or full name of the new ParameterTypeLength
  23.      */
  24.     public ParameterTypeLength(final String id, final String description)
  25.     {
  26.         super(id, description, Length.class);
  27.     }

  28.     /**
  29.      * Construct a new ParameterTypeLength with default value, without check.
  30.      * @param id String; short name of the new ParameterTypeLength
  31.      * @param description String; parameter description or full name of the new ParameterTypeLength
  32.      * @param defaultValue Length; the default value of the new ParameterTypeLength
  33.      */
  34.     public ParameterTypeLength(final String id, final String description, final Length defaultValue)
  35.     {
  36.         super(id, description, Length.class, defaultValue);
  37.     }

  38.     /**
  39.      * Construct a new ParameterTypeLength without default value, with check.
  40.      * @param id String; short name of the new ParameterTypeLength
  41.      * @param description String; parameter description or full name of the new ParameterTypeLength
  42.      * @param constraint Constraint&lt;? super Length&gt;; constraint for parameter values
  43.      */
  44.     public ParameterTypeLength(final String id, final String description, final Constraint<? super Length> constraint)
  45.     {
  46.         super(id, description, Length.class, constraint);
  47.     }

  48.     /**
  49.      * Construct a new ParameterTypeLength with default value and check.
  50.      * @param id String; short name of the new ParameterTypeLength
  51.      * @param description String; parameter description or full name of the new ParameterTypeLength
  52.      * @param defaultValue Length; the default value of the new ParameterTypeLength
  53.      * @param constraint Constraint&lt;? super Length&gt;; constraint for parameter values
  54.      */
  55.     public ParameterTypeLength(final String id, final String description, final Length defaultValue,
  56.             final Constraint<? super Length> constraint)
  57.     {
  58.         super(id, description, Length.class, defaultValue, constraint);
  59.     }

  60.     /** {@inheritDoc} */
  61.     @Override
  62.     public final String toString()
  63.     {
  64.         return "ParameterTypeLength [id=" + getId() + ", description=" + getDescription() + "]";
  65.     }

  66. }