Oops. We can't use Java 1.6 stuff in Depot (yet). Thanks Mr. Hoover.
This commit is contained in:
@@ -53,10 +53,10 @@ public abstract class Arithmetic extends MultiOperator
|
|||||||
public Object evaluate (Object[] operands)
|
public Object evaluate (Object[] operands)
|
||||||
{
|
{
|
||||||
return evaluate(operands, "+", new Accumulator<Double>() {
|
return evaluate(operands, "+", new Accumulator<Double>() {
|
||||||
@Override public Double accumulate (Double left, Double right) {
|
public Double accumulate (Double left, Double right) {
|
||||||
return left + right;
|
return left + right;
|
||||||
}}, new Accumulator<Long>() {
|
}}, new Accumulator<Long>() {
|
||||||
@Override public Long accumulate (Long left, Long right) {
|
public Long accumulate (Long left, Long right) {
|
||||||
return left + right;
|
return left + right;
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
@@ -84,10 +84,10 @@ public abstract class Arithmetic extends MultiOperator
|
|||||||
public Object evaluate (Object[] operands)
|
public Object evaluate (Object[] operands)
|
||||||
{
|
{
|
||||||
return evaluate(operands, "-", new Accumulator<Double>() {
|
return evaluate(operands, "-", new Accumulator<Double>() {
|
||||||
@Override public Double accumulate (Double left, Double right) {
|
public Double accumulate (Double left, Double right) {
|
||||||
return left - right;
|
return left - right;
|
||||||
}}, new Accumulator<Long>() {
|
}}, new Accumulator<Long>() {
|
||||||
@Override public Long accumulate (Long left, Long right) {
|
public Long accumulate (Long left, Long right) {
|
||||||
return left - right;
|
return left - right;
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
@@ -115,10 +115,10 @@ public abstract class Arithmetic extends MultiOperator
|
|||||||
public Object evaluate (Object[] operands)
|
public Object evaluate (Object[] operands)
|
||||||
{
|
{
|
||||||
return evaluate(operands, "*", new Accumulator<Double>() {
|
return evaluate(operands, "*", new Accumulator<Double>() {
|
||||||
@Override public Double accumulate (Double left, Double right) {
|
public Double accumulate (Double left, Double right) {
|
||||||
return left * right;
|
return left * right;
|
||||||
}}, new Accumulator<Long>() {
|
}}, new Accumulator<Long>() {
|
||||||
@Override public Long accumulate (Long left, Long right) {
|
public Long accumulate (Long left, Long right) {
|
||||||
return left * right;
|
return left * right;
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
@@ -151,10 +151,10 @@ public abstract class Arithmetic extends MultiOperator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return evaluate(operands, "/", new Accumulator<Double>() {
|
return evaluate(operands, "/", new Accumulator<Double>() {
|
||||||
@Override public Double accumulate (Double left, Double right) {
|
public Double accumulate (Double left, Double right) {
|
||||||
return left / right;
|
return left / right;
|
||||||
}}, new Accumulator<Long>() {
|
}}, new Accumulator<Long>() {
|
||||||
@Override public Long accumulate (Long left, Long right) {
|
public Long accumulate (Long left, Long right) {
|
||||||
return left / right;
|
return left / right;
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
@@ -182,7 +182,7 @@ public abstract class Arithmetic extends MultiOperator
|
|||||||
public Object evaluate (Object[] operands)
|
public Object evaluate (Object[] operands)
|
||||||
{
|
{
|
||||||
return evaluate(operands, "&", null, new Accumulator<Long>() {
|
return evaluate(operands, "&", null, new Accumulator<Long>() {
|
||||||
@Override public Long accumulate (Long left, Long right) {
|
public Long accumulate (Long left, Long right) {
|
||||||
return left & right;
|
return left & right;
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
@@ -210,7 +210,7 @@ public abstract class Arithmetic extends MultiOperator
|
|||||||
public Object evaluate (Object[] operands)
|
public Object evaluate (Object[] operands)
|
||||||
{
|
{
|
||||||
return evaluate(operands, "|", null, new Accumulator<Long>() {
|
return evaluate(operands, "|", null, new Accumulator<Long>() {
|
||||||
@Override public Long accumulate (Long left, Long right) {
|
public Long accumulate (Long left, Long right) {
|
||||||
return left | right;
|
return left | right;
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ public interface SQLOperator extends SQLExpression
|
|||||||
public static abstract class BaseOperator implements SQLOperator
|
public static abstract class BaseOperator implements SQLOperator
|
||||||
{
|
{
|
||||||
public static Function<Object, Long> INTEGRAL = new Function<Object, Long>() {
|
public static Function<Object, Long> INTEGRAL = new Function<Object, Long>() {
|
||||||
@Override public Long apply (Object o) {
|
public Long apply (Object o) {
|
||||||
if ((o instanceof Integer) || (o instanceof Long)) {
|
if ((o instanceof Integer) || (o instanceof Long)) {
|
||||||
return ((Number) o).longValue();
|
return ((Number) o).longValue();
|
||||||
}
|
}
|
||||||
@@ -162,19 +162,19 @@ public interface SQLOperator extends SQLExpression
|
|||||||
};
|
};
|
||||||
|
|
||||||
public static Function<Object, Double> NUMERICAL = new Function<Object, Double>() {
|
public static Function<Object, Double> NUMERICAL = new Function<Object, Double>() {
|
||||||
@Override public Double apply (Object o) {
|
public Double apply (Object o) {
|
||||||
return (o instanceof Number) ? ((Number) o).doubleValue() : null;
|
return (o instanceof Number) ? ((Number) o).doubleValue() : null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static Function<Object, String> STRING = new Function<Object, String>() {
|
public static Function<Object, String> STRING = new Function<Object, String>() {
|
||||||
@Override public String apply (Object o) {
|
public String apply (Object o) {
|
||||||
return (o instanceof String) ? (String) o : null;
|
return (o instanceof String) ? (String) o : null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static Function<Object, Date> DATE = new Function<Object, Date>() {
|
public static Function<Object, Date> DATE = new Function<Object, Date>() {
|
||||||
@Override public Date apply (Object o) {
|
public Date apply (Object o) {
|
||||||
return (o instanceof Date) ? (Date) o : null;
|
return (o instanceof Date) ? (Date) o : null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user