- Variable(Character c) throws NotCharacterException {
- v = new TreeMap<Character, Double>();
- //TODO?: remove extragenous whitespace
- if (Character.isLetterOrDigit(c)) {
- v.put(c, 0.0); // we suppose the default variable value is 0
- } else {
- throw new NotCharacterException(c + " is not a character type");
+ Variable() {
+ v = new TreeMap<Integer, Double>();
+ fill(-5.0, 5.0, 0.25);
+ }
+
+ /**
+ * 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 = start; d <= end; d = d + step) {
+ v.put(i, d);
+ i++;