Package com.google.refine.expr

Examples of com.google.refine.expr.EvalError


    @Override
    public Object call(Properties bindings, Object[] args) {
        if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
            return StrictMath.tanh(((Number) args[0]).doubleValue());
        }
        return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
    }
View Full Code Here


                Element e1 = (Element)o1;
                if(o2 != null && o2 instanceof String){
                    return e1.attr(o2.toString());
                }
            }else{
                return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " failed as the first parameter is not an HTML Element.  Please first use parseHtml(string) and select(query) prior to using this function");
            }
        }
        return null;
    }
View Full Code Here

    @Override
    public Object call(Properties bindings, Object[] args) {
        if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
            return StrictMath.sinh(((Number) args[0]).doubleValue());
        }
        return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
    }
View Full Code Here

                Element e1 = (Element)o1;
                if(o2 != null && o2 instanceof String){
                    return e1.select(o2.toString());
                }
            }else{
                return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " failed as the first parameter is not an HTML Element.  Please first use parseHtml(string)");
            }
        }
        return null;
    }
View Full Code Here

    @Override
    public Object call(Properties bindings, Object[] args) {
        if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
            return Odd.roundUpToOdd(((Number) args[0]).doubleValue());
        }
        return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
    }
View Full Code Here

            if (o1 != null && o1 instanceof Element) {
                Element e1 = (Element)o1;
                return e1.ownText();

            }else{
                return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " failed as the first parameter is not an HTML Element.  Please first use parseHtml(string) and select(query) prior to using this function");
            }
        }
        return null;
    }
View Full Code Here

    @Override
    public Object call(Properties bindings, Object[] args) {
        if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
            return Math.cos(((Number) args[0]).doubleValue());
        }
        return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
    }
View Full Code Here

            if (o1 != null && o1 instanceof Element) {
                Element e1 = (Element)o1;
                return e1.html();

            }else{
                return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " failed as the first parameter is not an HTML Element.  Please first use parseHtml(string) and select(query) prior to using this function");
            }
        }
        return null;
    }
View Full Code Here

           
            date.add(getField(unit), amount);
           
            return date;
        }
        return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a date, a number and a string");
    }
View Full Code Here

    @Override
    public Object call(Properties bindings, Object[] args) {
        if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
            return Math.round(((Number) args[0]).doubleValue());
        }
        return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
    }
View Full Code Here

TOP

Related Classes of com.google.refine.expr.EvalError

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.