Class ParameterTypeClassList<T>

java.lang.Object
org.opentrafficsim.base.Type<ParameterType<T>>
org.opentrafficsim.base.parameters.ParameterType<List<Class<? extends T>>>
org.opentrafficsim.base.parameters.ParameterTypeClassList<T>
Type Parameters:
T - class, e.g. TacticalPlanner
All Implemented Interfaces:
Serializable, Identifiable

public class ParameterTypeClassList<T>
extends ParameterType<List<Class<? extends T>>>
Parameter type for a list of classes, each of which may need to be present in a constraint set.

Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Version:
$Revision$, $LastChangedDate$, by $Author$, initial version 30 jun. 2017
Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
See Also:
Serialized Form
  • Constructor Details

    • ParameterTypeClassList

      public ParameterTypeClassList​(String id, String description, Class<List<Class<? extends T>>> valueClass)
      Constructor without default value and check.
      Parameters:
      id - String; Short name of parameter.
      description - String; Parameter description or full name.
      valueClass - Class<List<Class<? extends T>>>; Class of the value.
    • ParameterTypeClassList

      public ParameterTypeClassList​(String id, String description, Class<List<Class<? extends T>>> valueClass, List<Class<? extends T>> defaultValue)
      Constructor with default value, without check.
      Parameters:
      id - String; Short name of parameter.
      description - String; Parameter description or full name.
      valueClass - Class<List<Class<? extends T>>>; Class of the value.
      defaultValue - List<Class<? extends T>>; Default value.
    • ParameterTypeClassList

      public ParameterTypeClassList​(String id, String description, Class<List<Class<? extends T>>> valueClass, Constraint<? super List<Class<? extends T>>> constraint)
      Constructor without default value, with check.
      Parameters:
      id - String; Short name of parameter.
      description - String; Parameter description or full name.
      valueClass - Class<List<Class<? extends T>>>; Class of the value.
      constraint - Constraint<? super List<Class<? extends T>>>; Constraint for parameter values.
    • ParameterTypeClassList

      public ParameterTypeClassList​(String id, String description, Class<List<Class<? extends T>>> valueClass, List<Class<? extends T>> defaultValue, Constraint<? super List<Class<? extends T>>> constraint)
      Constructor with default value and check.
      Parameters:
      id - String; Short name of parameter.
      description - String; Parameter description or full name.
      valueClass - Class<List<Class<? extends T>>>; Class of the value.
      defaultValue - List<Class<? extends T>>; Default value.
      constraint - Constraint<? super List<Class<? extends T>>>; Constraint for parameter values.
  • Method Details

    • getValueClass

      public static <T> Class<List<Class<? extends T>>> getValueClass​(Class<T> clazz)
      Returns a typed class, where the type is List<Class<? extends T>>, such that ParameterTypeClass instances can easily be created.
      Type Parameters:
      T - constraining class in parameter type, e.g. TacticalPlanner
      Parameters:
      clazz - Class<T>; class instance
      Returns:
      typed class
    • printValue

      public String printValue​(Parameters parameters) throws ParameterException
      Print the given value from the map in Parameters in a presentable format. The default implementation simply returns the output of toString().
      Overrides:
      printValue in class ParameterType<List<Class<? extends T>>>
      Parameters:
      parameters - Parameters; Parameters to get the value from
      Returns:
      String; readable representation of the value
      Throws:
      ParameterException - If the parameter is not present
    • toString

      public String toString()
      Overrides:
      toString in class ParameterType<List<Class<? extends T>>>