remove obsolete Value class since we currently only use plain-old Integers
This commit is contained in:
@@ -1,59 +0,0 @@
|
||||
package de.hsrm.compiler.Klang;
|
||||
|
||||
public class Value {
|
||||
|
||||
public static Value VOID = new Value(new Object());
|
||||
|
||||
final Object value;
|
||||
|
||||
public Value(Object value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Boolean asBoolean() {
|
||||
return (Boolean)value;
|
||||
}
|
||||
|
||||
public Double asDouble() {
|
||||
return (Double)value;
|
||||
}
|
||||
|
||||
public String asString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
public boolean isDouble() {
|
||||
return value instanceof Double;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
if(value == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return this.value.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
if(value == o) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(value == null || o == null || o.getClass() != value.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Value that = (Value)o;
|
||||
|
||||
return this.value.equals(that.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user