public class ParameterizedState<T extends java.lang.Enum<T> & ParameterEnum>
extends java.lang.Object
Parameter
objects, i.e., named, ordered, enumerated keys associated with
values of mixed type via a key -> key, value map.
See GibbsSamplerSingleGaussianUnitTest and GibbsSamplerCopyRatioUnitTest for examples of use.Constructor and Description |
---|
ParameterizedState(java.util.List<Parameter<T,?>> parameters)
Constructs a
ParameterizedState with parameters enumerated by ParameterEnum
from a List of Parameter objects with values of mixed type,
checking that all parameters are present without duplicates. |
ParameterizedState(ParameterizedState<T> state)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
protected <S extends ParameterizedState<T>> |
copy() |
<U> U |
get(T parameterKey,
java.lang.Class<U> parameterValueClass)
Returns the value of a
Parameter contained in the collection held by the ParameterizedState ,
given the ParameterEnum key and type of the Parameter . |
java.util.Set<T> |
keySet()
Returns a Set of the keys of the
Parameter objects that are held internally as values of the parameter map. |
protected <U> void |
update(T parameterName,
U value)
Updates the value of a
Parameter contained in the collection held by the ParameterizedState . |
java.util.List<Parameter<T,?>> |
values()
Returns a List of the
Parameter objects that are held internally as values of the parameter map. |
public ParameterizedState(java.util.List<Parameter<T,?>> parameters)
ParameterizedState
with parameters enumerated by ParameterEnum
from a List of Parameter
objects with values of mixed type,
checking that all parameters are present without duplicates.parameters
- List of Parametersjava.lang.IllegalArgumentException
- if parameters
is null, empty, contains duplicate parameter names, or missing parameter namespublic ParameterizedState(ParameterizedState<T> state)
state
- state to be copiedpublic java.util.Set<T> keySet()
Parameter
objects that are held internally as values of the parameter map.
The order of the parameters in the set is the same as in the list passed to the constructor.Parameter
objects held internally as values of the parameter mappublic java.util.List<Parameter<T,?>> values()
Parameter
objects that are held internally as values of the parameter map.
The order of the parameters in the list is the same as in the list passed to the constructor.Parameter
objects held internally as values of the parameter mappublic <U> U get(T parameterKey, java.lang.Class<U> parameterValueClass)
Parameter
contained in the collection held by the ParameterizedState
,
given the ParameterEnum
key and type of the Parameter
.protected <U> void update(T parameterName, U value)
Parameter
contained in the collection held by the ParameterizedState
.U
- type of Parameter
valueparameterName
- ParameterEnum
key of Parameter
to updatevalue
- new Parameter
valuejava.lang.IllegalArgumentException
- if parameterName
does not correspond to a Parameter
in the collectionprotected <S extends ParameterizedState<T>> S copy()