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