Revision: 8431
http://svn.sourceforge.net/foray/?rev=8431&view=rev
Author: victormote
Date: 2006-10-26 17:10:48 -0700 (Thu, 26 Oct 2006)
Log Message:
-----------
Remove no-longer-needed method, replacing it with pre-existing method in ExprNumeric.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/Expr.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/ExprMultiplicativeOper.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/Expr.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/Expr.java 2006-10-26 22:27:40 UTC (rev 8430)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/Expr.java 2006-10-27 00:10:48 UTC (rev 8431)
@@ -76,8 +76,4 @@
return 0;
}
- public double evalNumeric() {
- return 0;
- }
-
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/ExprMultiplicativeOper.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/ExprMultiplicativeOper.java 2006-10-26 22:27:40 UTC (rev 8430)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/ExprMultiplicativeOper.java 2006-10-27 00:10:48 UTC (rev 8431)
@@ -42,12 +42,12 @@
public ExprMultiplicativeOper(final ExprMultiplicative operand1,
final ExprUnary operand2, final byte operation)
throws PropertyException {
- if (operand1.unitPower() < 0) {
+ if (! (operand1 instanceof ExprNumeric)) {
throw new PropertyException(this.getClass().getName()
+ ": Non-numeric operand: " + operand1.toString());
}
this.operand1 = operand1;
- if (operand2.unitPower() < 0) {
+ if (! (operand2 instanceof ExprNumeric)) {
throw new PropertyException(this.getClass().getName()
+ "Non-numeric operand: " + operand2.toString());
}
@@ -87,7 +87,8 @@
if (operand1.unitPower() == 1) {
rawOperand1 = operand1.evalUnitPower1(pointSize, percentBase);
} else {
- rawOperand1 = operand1.evalNumeric();
+ /* Cast verified during construction. */
+ rawOperand1 = ((ExprNumeric) operand1).getNumericValue();
}
// Compute raw value for operand2
@@ -95,7 +96,7 @@
if (operand2.unitPower() == 1) {
rawOperand2 = operand2.evalUnitPower1(pointSize, percentBase);
} else {
- rawOperand2 = operand2.evalNumeric();
+ rawOperand2 = ((ExprNumeric) operand2).getNumericValue();
}
double rawValue = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|