Package nl.tno.imb.mc
Class ModelParameters
java.lang.Object
nl.tno.imb.mc.ModelParameters
- All Implemented Interfaces:
SelfWrapper
public class ModelParameters extends Object implements SelfWrapper
Container for a list of model parameters.
For now this object is immutable.
For now this object is immutable.
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 Oct 17, 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Constructor Summary
Constructors Constructor Description ModelParameters(TByteBuffer payload)Construct ModelParameters from a IMB ByteBuffer -
Method Summary
Modifier and Type Method Description booleanaddParameter(Parameter parameter)Add a parameter.ParametergetParameterByName(String name)Retrieve the parameter with a specified nameList<String>getParameterNames()Retrieve the names of all stored parameters.Parameter.ParameterTypegetParameterType(String name)Retrieve the type of a parameter.ObjectgetParameterValue(String name)Retrieve the value of a parameter.booleanparameterExists(String name)Report if this ModelParameters object contains a parameter with the specified name.voidprepare(TByteBuffer payload)Perform the prepare operation.voidqWrite(TByteBuffer payload)Perform the qWrite operation.StringtoString()
-
Constructor Details
-
ModelParameters
Construct ModelParameters from a IMB ByteBuffer- Parameters:
payload- TByteBuffer;- Throws:
IMBException
-
-
Method Details
-
getParameterByName
Retrieve the parameter with a specified name- Parameters:
name- String; name of the parameter to look up- Returns:
- Parameter; the parameter with the specified name, or null if no parameter with the specified name exists in this ModelParameters object
-
getParameterNames
Retrieve the names of all stored parameters. The returned object is a deep copy and may be modified by the caller.- Returns:
- List<String>; the names of all stored parameters
-
parameterExists
Report if this ModelParameters object contains a parameter with the specified name.- Parameters:
name- String; name of the parameter- Returns:
- boolean; true if such a parameter exists; false if such a parameter does not exist
-
getParameterType
Retrieve the type of a parameter.- Parameters:
name- String; name of the parameter- Returns:
- Parameter.ParameterType; the type of the parameter
- Throws:
IMBException- when no parameter with the specified name exists in this ModelParameters object
-
getParameterValue
Retrieve the value of a parameter.- Parameters:
name- String; name of the parameter- Returns:
- Object; the value of the parameter
- Throws:
IMBException- when no parameter with the specified name exists in this ModelParameters object
-
addParameter
Add a parameter. The name of the parameter must be unique.- Parameters:
parameter- Parameter; Parameter- Returns:
- boolean; true if the parameter was added
-
prepare
Perform the prepare operation.- Specified by:
preparein interfaceSelfWrapper- Parameters:
payload- TByteBuffer; the buffer to prepare for reception of the object that implements this interface
-
qWrite
Perform the qWrite operation.- Specified by:
qWritein interfaceSelfWrapper- Parameters:
payload- TByteBuffer; the buffer on which to apply the qWrite operation
-
toString
-