Package org.boris.xlloop.xloper

Examples of org.boris.xlloop.xloper.XLoper


    public void add(String name, boolean value) {
        map.put(name, new XLBool(value));
    }

    public String getString(String name) {
        XLoper x = map.get(name);
        if (x instanceof XLString)
            return ((XLString) x).str;
        if (x == null)
            return null;
        return x.toString();
    }
View Full Code Here


            JSONException {
        BufferedWriter bw = new BufferedWriter(output);
        try {
            FunctionRequest fr = JSONCodec.decodeRequest(input);
            System.out.println(JSONCodec.encodeRequest(fr).toString(4));
            XLoper res = handler.execute(null, fr.getName(), fr.getArgs());
            System.out.println(JSONCodec.encode(res).toString(4));
            JSONCodec.encodeXLoper(res, bw);
        } catch (RequestException e) {
            e.printStackTrace();
            XLoper res = new XLString(e.getMessage());
            JSONCodec.encodeXLoper(res, bw);
            bw.flush();
        } finally {
            if (bw != null)
                bw.flush();
View Full Code Here

            return null;
        return x.toString();
    }

    public Double getDouble(String name) {
        XLoper x = map.get(name);
        if (x instanceof XLNum)
            return ((XLNum) x).num;
        else if (x instanceof XLInt)
            return (double) ((XLInt) x).w;
        else if (x instanceof XLBool)
View Full Code Here

            return;
        }

        for (int i = 0; i < array.length; i += 2) {
            String key = array.array[i].toString();
            XLoper value = array.array[i + 1];
            map.put(key, value);
        }
    }
View Full Code Here

    public XLoper get(int index) {
        return (XLoper) list.get(index);
    }

    public String getString(int index) {
        XLoper x = get(index);
        if (x instanceof XLString)
            return ((XLString) x).str;
        return null;
    }
View Full Code Here

            maxCol = column;
        values.put(new ArrayRef(row, column), value);
    }

    public String getString(int row, int column) {
        XLoper x = get(row, column);
        if (x instanceof XLString)
            return ((XLString) x).str;
        return null;
    }
View Full Code Here

            return ((XLString) x).str;
        return null;
    }

    public Double getDouble(int row, int column) {
        XLoper x = get(row, column);
        if (x instanceof XLNum)
            return ((XLNum) x).num;
        else if (x instanceof XLInt)
            return (double) ((XLInt) x).w;
        else if (x instanceof XLBool)
View Full Code Here

    public XLoper execute(IFunctionContext context, String name, XLoper[] args) throws RequestException {
        try {
            LispValue inValue = makeList(args, findSize(args));
            LispValue result = jatha.eval(inValue);
            XLoper outValue = makeResult(result);
            return outValue;
        } catch (Exception e) {
            e.printStackTrace();
            throw new RequestException(e);
        }
View Full Code Here

        int size;
        if (args == null || (size = args.length) == 0) {
            return 0;
        }
        while (size > 0) {
            XLoper v = args[--size];
            if (!(v instanceof XLMissing)) {
                return size + 1;
            }
        }
        return 0;
View Full Code Here

    }

    public static Class[] createArgHints(XLoper[] args) {
        Class[] hints = new Class[args.length];
        for (int i = 0; i < hints.length; i++) {
            XLoper v = args[i];
            if (v instanceof XLArray) {
                XLArray c = (XLArray) v;
                if (c.columns > 1) {
                    hints[i] = Object[][].class;
                } else {
View Full Code Here

TOP

Related Classes of org.boris.xlloop.xloper.XLoper

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.