Константа ZERO вынесена в класс NumberValue

This commit is contained in:
Victor 2015-06-18 10:19:31 +03:00
parent 7756e36179
commit ebed2615d5
3 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,6 @@ import java.util.Map;
*/
public final class Functions {
private static final NumberValue ZERO = new NumberValue(0);
private static final Map<String, Function> functions;
static {
@ -30,7 +29,7 @@ public final class Functions {
for (Value arg : args) {
System.out.println(arg.asString());
}
return ZERO;
return NumberValue.ZERO;
});
}

View File

@ -6,6 +6,8 @@ package com.annimon.ownlang.lib;
*/
public final class NumberValue implements Value {
public static final NumberValue ZERO = new NumberValue(0);
private final double value;
public NumberValue(boolean value) {

View File

@ -9,7 +9,6 @@ import java.util.Map;
*/
public final class Variables {
private static final NumberValue ZERO = new NumberValue(0);
private static final Map<String, Value> variables;
static {
@ -25,7 +24,7 @@ public final class Variables {
}
public static Value get(String key) {
if (!isExists(key)) return ZERO;
if (!isExists(key)) return NumberValue.ZERO;
return variables.get(key);
}