public interface Parameters
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.
Modifier and Type | Method and Description |
---|---|
boolean |
contains(ParameterType<?> parameterType)
Indicate whether the given parameter type has been set.
|
<T> T |
getParameter(ParameterType<T> parameterType)
Get parameter of given type.
|
<T> T |
getParameterOrNull(ParameterType<T> parameterType)
Returns a parameter value, or
null if not present. |
void |
resetParameter(ParameterType<?> parameterType)
Resets the parameter value to the value from before the last set.
|
void |
setAllIn(Parameters parameters)
Sets the parameters of this set in the given set.
|
<T> void |
setParameter(ParameterType<T> parameterType,
T value)
Set parameter value of given parameter type.
|
<T> void |
setParameterResettable(ParameterType<T> parameterType,
T value)
Set parameter value of given parameter type, store old value to allow a reset.
|
<T> void setParameter(ParameterType<T> parameterType, T value) throws ParameterException
T
- Class of value.parameterType
- ParameterType<T>; the parameter type.value
- T; new value for the parameter of type parameterType
.ParameterException
- If the value does not comply with value type constraints.<T> void setParameterResettable(ParameterType<T> parameterType, T value) throws ParameterException
T
- Class of value.parameterType
- ParameterType<T>; the parameter type.value
- T; new value for the parameter of type parameterType
.ParameterException
- If the value does not comply with value type constraints.void resetParameter(ParameterType<?> parameterType) throws ParameterException
parameterType
- ParameterType<?>; the parameter type.ParameterException
- If the parameter was never set.<T> T getParameter(ParameterType<T> parameterType) throws ParameterException
T
- Class of value.parameterType
- ParameterType<T>; the parameter type.ParameterException
- If the parameter was never set.<T> T getParameterOrNull(ParameterType<T> parameterType)
null
if not present. This can be used to prevent frequent calls to both
contains()
and getParameter()
in performance critical code.T
- type of parameter valueparameterType
- ParameterType<T>; parameter typenull
if not presentboolean contains(ParameterType<?> parameterType)
parameterType
- ParameterType<?>; the parameter type to checkparameterType
has been set; false if parameterType
has not been setvoid setAllIn(Parameters parameters)
parameters
- Parameters; parameters to set the values inCopyright © 2014–2019 Delft University of Technology. All rights reserved.