…lines 1–12 unchanged (12 lines)
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17package org.apache.commons.jxpath.ri.compiler;
18
19import org.apache.commons.jxpath.ri.EvalContext;
20import org.apache.commons.jxpath.ri.InfoSetUtil;
21/**
22 * Implementation of Expression for the operation "<".
23 *
24 * @author Dmitri Plotnikov
25 * @version $Revision$ $Date$
26 */
27public class CoreOperationLessThan extends CoreOperationRelationalExpression {
28
29 public CoreOperationLessThan(Expression arg1, Expression arg2) {
30 super(new Expression[] { arg1, arg2 });
31 }
32
33 public Object computeValue(EvalContext context) {
34 double l = InfoSetUtil.doubleValue(args[0].computeValue(context));
35 double r = InfoSetUtil.doubleValue(args[1].computeValue(context));
36 return l < r ? Boolean.TRUE : Boolean.FALSE;
37 }
38
39 public String getSymbol() {
40 return "<";
41 }
42}
43