3
// (c) 1999-2004 PAL Development Core Team
5
// This package may be distributed under the
6
// terms of the Lesser GNU General Public License (LGPL)
12
import java.util.Enumeration;
17
* interface for holding a double, that may be mutated and referenced by more than one user
19
* @version $Id: MutableDouble.java,v 1.2 2004/10/19 02:23:19 matt Exp $
21
* @author Matthew Goode
26
public class MutableDouble implements java.io.Serializable{
27
private final double defaultValue_;
28
private final double minimumValue_;
29
private final double maximumValue_;
31
private double currentValue_;
33
private final String name_;
35
/** The default value is also the initial value.
37
public MutableDouble(double initialValue, double defaultValue, double minimumValue, double maximumValue, String name) {
38
this.currentValue_ = defaultValue;
39
this.defaultValue_ = defaultValue;
40
this.minimumValue_ = minimumValue;
41
this.maximumValue_ = maximumValue;
45
/** Set the current value of this double */
46
public final void setValue(double value) { this.currentValue_ = value; }
48
/** Get the current value of this double */
49
public final double getValue() { return currentValue_; }
51
public final double getLowerLimit() { return minimumValue_; }
53
public final double getUpperLimit() { return maximumValue_; }
55
public final double getDefaultValue() { return defaultValue_; }
57
public final double getSE() { return se_; }
58
public final void setSE(double value) { se_ = value; }
59
public final String getName() { return name_; }
60
public String toString() {
61
return name_+":"+currentValue_;