ParameterType
- Type of parameter of the conditional distribution.ConditionalType
- Type of parameterized distribution that generates observations.public class DefaultDistributionParameter<ParameterType,ConditionalType extends ClosedFormDistribution<?>> extends AbstractNamed implements DistributionParameter<ParameterType,ConditionalType>
Modifier and Type | Field and Description |
---|---|
protected ConditionalType |
conditionalDistribution
Distribution from which to pull the parameters.
|
static java.lang.String |
MEAN_GETTER
Getter for the mean, "getMean".
|
static java.lang.String |
MEAN_NAME
Name of the mean property, "mean".
|
static java.lang.String |
MEAN_SETTER
Setter for the mean, "setMean".
|
protected java.lang.reflect.Method |
parameterGetter
Getter for the parameter, the write method.
|
protected java.lang.reflect.Method |
parameterSetter
Setter for the parameter, the read method.
|
name
Constructor and Description |
---|
DefaultDistributionParameter(ConditionalType conditionalDistribution,
java.beans.PropertyDescriptor descriptor)
Creates a new instance of DefaultDistributionParameter
|
DefaultDistributionParameter(ConditionalType conditionalDistribution,
java.lang.String parameterName)
Creates a new instance of DefaultDistributionParameter
|
Modifier and Type | Method and Description |
---|---|
protected void |
assignParameterMethods(Distribution<?> conditionalDistribution,
java.lang.String parameterName)
Assigns the getter and setter from the given conditionalDistribution and parameter
name.
|
DefaultDistributionParameter<ParameterType,ConditionalType> |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
ConditionalType |
getConditionalDistribution()
Gets the conditional distribution associated with the parameter.
|
ParameterType |
getValue()
Gets the value stored in the name-value pair.
|
protected void |
setConditionalDistribution(ConditionalType conditionalDistribution)
Setter for conditionalDistribution
|
void |
setName(java.lang.String name)
Sets the name of this Object.
|
void |
setValue(ParameterType value)
Sets the value of the parameter.
|
getName, toString
protected ConditionalType extends ClosedFormDistribution<?> conditionalDistribution
protected transient java.lang.reflect.Method parameterSetter
protected transient java.lang.reflect.Method parameterGetter
public static final java.lang.String MEAN_NAME
public static final java.lang.String MEAN_SETTER
public static final java.lang.String MEAN_GETTER
public DefaultDistributionParameter(ConditionalType conditionalDistribution, java.lang.String parameterName)
conditionalDistribution
- Distribution from which to pull the parameters.parameterName
- Name of the parameterpublic DefaultDistributionParameter(ConditionalType conditionalDistribution, java.beans.PropertyDescriptor descriptor)
conditionalDistribution
- Distribution from which to pull the parameters.descriptor
- PropertyDescriptor from the Introspector that has a setter and a getter.public DefaultDistributionParameter<ParameterType,ConditionalType> clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface CloneableSerializable
clone
in class AbstractNamed
protected void assignParameterMethods(Distribution<?> conditionalDistribution, java.lang.String parameterName)
conditionalDistribution
- Distribution from which to pull the parameters.parameterName
- Name of the parameterpublic ParameterType getValue()
NamedValue
getValue
in interface NamedValue<ParameterType>
public void setValue(ParameterType value)
DistributionParameter
setValue
in interface DistributionParameter<ParameterType,ConditionalType extends ClosedFormDistribution<?>>
value
- Parameter to set.public ConditionalType getConditionalDistribution()
DistributionParameter
getConditionalDistribution
in interface DistributionParameter<ParameterType,ConditionalType extends ClosedFormDistribution<?>>
protected void setConditionalDistribution(ConditionalType conditionalDistribution)
conditionalDistribution
- Conditional conditionalDistribution associated with the parameter.public void setName(java.lang.String name)
AbstractNamed
setName
in class AbstractNamed
name
- The new name for the Object.