use of dr.inference.model.Bounds in project beast-mcmc by beast-dev.
the class ImmutableParameterParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
final Statistic statistic = (Statistic) xo.getChild(Statistic.class);
Parameter.Abstract immutableParameter = new Parameter.Abstract() {
public void setParameterValueNotifyChangedAll(int dim, double value) {
throw new RuntimeException("Forbidden call to ImmutableParameter.");
}
public void setParameterValueQuietly(int dim, double value) {
throw new RuntimeException("Forbidden call to ImmutableParameter.");
}
public void storeValues() {
//do nothing
}
public void restoreValues() {
//do nothing
}
public void acceptValues() {
//do nothing
}
public int getDimension() {
return statistic.getDimension();
}
public void setParameterValue(int dim, double value) {
throw new RuntimeException("Forbidden call to ImmutableParameter.");
}
public double getParameterValue(int dim) {
return statistic.getStatisticValue(dim);
}
public String getParameterName() {
if (getId() == null)
return "immutable." + statistic.getStatisticName();
return getId();
}
public void adoptValues(Parameter source) {
throw new RuntimeException("Forbidden call to ImmutableParameter.");
}
public void addDimension(int index, double value) {
throw new RuntimeException("Forbidden call to ImmutableParameter.");
}
public double removeDimension(int index) {
throw new RuntimeException("Forbidden call to ImmutableParameter.");
}
public void addBounds(Bounds<Double> bounds) {
throw new RuntimeException("Forbidden call to ImmutableParameter.");
}
public Bounds<Double> getBounds() {
throw new RuntimeException("Forbidden call to ImmutableParameter.");
}
};
return immutableParameter;
}