From: Jérôme Benoit Date: Sun, 15 Apr 2018 19:40:31 +0000 (+0200) Subject: exo6: add arguments and comments the filling variable method. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=bd83b176f508492a46cc4f76998721c30a22d291;p=Project_POO.git exo6: add arguments and comments the filling variable method. Signed-off-by: Jérôme Benoit --- diff --git a/exo6/Variable.java b/exo6/Variable.java index 807ec8d..6a85fbb 100644 --- a/exo6/Variable.java +++ b/exo6/Variable.java @@ -7,12 +7,18 @@ class Variable extends Terme { Variable() { v = new TreeMap(); - fill(); + fill(-5.0, 5.0, 0.25); } - private void fill() { + /** + * Fill the variable with a discret set of double values + * @param start starting double value + * @param end ending double value + * @param step looping step + */ + private void fill(double start, double end, double step) { int i = 0; - for (double d = -5.0; d <= 5.0; d = d + 0.25) { + for (double d = start; d <= end; d = d + step) { v.put(i, d); i++; }