Package nl.tno.imb.mc
Class Parameter
- java.lang.Object
-
- nl.tno.imb.mc.Parameter
-
public class Parameter extends Object
IMB model control parameter.Copyright (c) 2013-2020 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 Oct 14, 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParameter.ParameterTypeIMB integer numbers and our corresponding enum values.
-
Constructor Summary
Constructors Constructor Description Parameter(String name, double value)Construct a new float parameter.Parameter(String name, int value)Construct a new integer parameter.Parameter(String name, Boolean value)Construct a Boolean parameter.Parameter(String name, String value)Construct a String parameter.Parameter(TByteBuffer payload)Construct a new Parameter from the next object in a TByteBuffer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()Parameter.ParameterTypegetType()ObjectgetValue()List<String>getValueList()voidprepare(TByteBuffer payload)Prepare this parameter for transmission over IMB.voidqWrite(TByteBuffer payload)Prepare this parameter for transmission over IMB.voidsetValueList(List<String> list)Set the list of pre-defined options that the user may choose from.StringtoString()
-
-
-
Constructor Detail
-
Parameter
public Parameter(String name, double value)
Construct a new float parameter.- Parameters:
name- String; name of the new float parametervalue- double; value of the new float parameter
-
Parameter
public Parameter(String name, Boolean value)
Construct a Boolean parameter.- Parameters:
name- String; the name of the new Boolean parametervalue- Boolean; the value of the new Boolean parameter
-
Parameter
public Parameter(String name, int value)
Construct a new integer parameter.- Parameters:
name- String; name of the new integer parametervalue- int; value of the new integer parameter
-
Parameter
public Parameter(String name, String value)
Construct a String parameter.- Parameters:
name- String; the name of the new String parametervalue- String; the value of the new String parameter
-
Parameter
public Parameter(TByteBuffer payload) throws IMBException
Construct a new Parameter from the next object in a TByteBuffer.- Parameters:
payload- TByteBuffer; the received IMB data- Throws:
IMBException- when the received type cannot be converted to a Parameter sub-type
-
-
Method Detail
-
prepare
public void prepare(TByteBuffer payload)
Prepare this parameter for transmission over IMB.- Parameters:
payload- TByteBuffer; the transmission buffer
-
qWrite
public void qWrite(TByteBuffer payload)
Prepare this parameter for transmission over IMB.- Parameters:
payload- TByteBuffer; the transmission buffer
-
setValueList
public void setValueList(List<String> list)
Set the list of pre-defined options that the user may choose from.- Parameters:
list- List<String>; the list of options
-
getName
public String getName()
- Returns:
- name.
-
getValue
public Object getValue()
- Returns:
- value.
-
getType
public Parameter.ParameterType getType()
- Returns:
- type.
-
-