| /******************************************************************************* |
| * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 |
| * Jesper Steen Moeller - bug 285145 - implement full arity checking |
| * Jesper Steen Moeller - bug 280555 - Add pluggable collation support |
| * Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4 |
| *******************************************************************************/ |
| |
| package org.eclipse.wst.xml.xpath2.processor.internal.function; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.wst.xml.xpath2.processor.DynamicContext; |
| import org.eclipse.wst.xml.xpath2.processor.DynamicError; |
| import org.eclipse.wst.xml.xpath2.processor.ResultSequence; |
| import org.eclipse.wst.xml.xpath2.processor.internal.types.QName; |
| |
| /** |
| * Class for the Greater than function. |
| */ |
| public class FsGt extends Function { |
| /** |
| * Constructor for FsGt. |
| */ |
| public FsGt() { |
| super(new QName("gt"), 2); |
| } |
| |
| /** |
| * Evaluate arguments. |
| * |
| * @param args |
| * argument expressions. |
| * @throws DynamicError |
| * Dynamic error. |
| * @return Result of evaluation. |
| */ |
| public ResultSequence evaluate(Collection args) throws DynamicError { |
| assert args.size() >= min_arity() && args.size() <= max_arity(); |
| |
| return fs_gt_value(args, dynamic_context()); |
| } |
| |
| /** |
| * Operation on the values of the arguments. |
| * |
| * @param args |
| * input arguments. |
| * @param dynamic |
| * Dynamic contexet |
| * @throws DynamicError |
| * Dynamic error. |
| * @return Result of the operation. |
| */ |
| public static ResultSequence fs_gt_value(Collection args, DynamicContext dynamic) |
| throws DynamicError { |
| return FsEq.do_cmp_value_op(args, CmpGt.class, "gt", dynamic); |
| } |
| |
| /** |
| * General operation on the arguments. |
| * |
| * @param args |
| * input arguments. |
| * @param dc |
| * The dynamic context |
| * @throws DynamicError |
| * Dynamic error. |
| * @return Result of the operation. |
| */ |
| public static ResultSequence fs_gt_general(Collection args, DynamicContext dc) |
| throws DynamicError { |
| return FsEq.do_cmp_general_op(args, FsGt.class, "fs_gt_value", dc); |
| } |
| |
| } |