A Control without a graphical user interface. @author Joshua Gould @version 1.0
| 17 | * @version 1.0 |
| 18 | */ |
| 19 | public class HiddenControl implements Control { |
| 20 | HashMap<String, String> map = new HashMap<String, String>(); |
| 21 | NumberFormat numberFormat = NumberFormat.getInstance(); |
| 22 | |
| 23 | /** |
| 24 | * Locks the control's interface. Values sent to the control will not |
| 25 | * update the display until the control is unlocked. |
| 26 | * |
| 27 | * @param lock boolean |
| 28 | */ |
| 29 | @Override |
| 30 | public void setLockValues(boolean lock) { |
| 31 | // this control does not have a user interface |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Adds an initial value of a parameter to the input display. Input parameters |
| 36 | * should be read when the calculation is performed. |
| 37 | * |
| 38 | *@param par the parameter name |
| 39 | *@param val the initial parameter value |
| 40 | *@since |
| 41 | */ |
| 42 | @Override |
| 43 | public void setValue(String par, Object val) { |
| 44 | map.put(par, val.toString()); |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Add an initial boolean value of a parameter to the input display. Input |
| 49 | * parameters should be read when the calculation is performed. |
| 50 | * |
| 51 | *@param par the parameter name |
| 52 | *@param val the initial parameter value |
| 53 | *@since |
| 54 | */ |
| 55 | @Override |
| 56 | public void setValue(String par, boolean val) { |
| 57 | map.put(par, String.valueOf(val)); |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Add an initial value of a parameter to the input display. Input parameters |
| 62 | * should be read when the calculation is performed. |
| 63 | * |
| 64 | *@param par the parameter name |
| 65 | *@param val the initial parameter value |
| 66 | *@since |
| 67 | */ |
| 68 | @Override |
| 69 | public void setValue(String par, double val) { |
| 70 | map.put(par, Double.toString(val)); |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Add an initial value of a parameter to the input display. Input parameters |
| 75 | * should be read when the calculation is performed. |
| 76 | * |
nothing calls this directly
no test coverage detected