Examples of XLList


Examples of org.boris.xlloop.util.XLList

            s.add("shortcutText", shortcutText);
        if (helpTopic != null)
            s.add("helpTopic", helpTopic);
        if (arguments.size() > 0) {
            s.add("argumentText", CSV.toCSV((String[]) arguments.toArray(new String[0])));
            XLList c = new XLList();
            for (int i = 0; i < argumentHelp.size(); i++) {
                c.add((String) argumentHelp.get(i));
            }
            s.add("argumentHelp", c);
        }
        if (isVolatile)
            s.add("isVolatile", true);
View Full Code Here

Examples of org.boris.xlloop.util.XLList

            return new XLInt((int) ((StandardLispInteger) value).getValue());
        } else if (value instanceof StandardLispReal) {
            return new XLNum(((StandardLispReal) value).getDoubleValue());
        } else if (value instanceof StandardLispCons) {
            StandardLispCons c = (StandardLispCons) value;
            XLList coll = new XLList();
            for (int i = 0; i < c.basic_length(); i++) {
                coll.add(makeResult(c.elt(i)));
            }
            return coll.toXLoper();
        } else if (value instanceof StandardLispNIL || value == null) {
            return XLNil.NIL;
        } else {
            return new XLString(registry.put(value));
        }
View Full Code Here

Examples of org.boris.xlloop.util.XLList

    public String getCategory() {
        return category;
    }

    public XLoper execute(IFunctionContext context, String name, XLoper[] args) throws RequestException {
        XLList c = new XLList();
        Map m = new TreeMap();
        for (Iterator i = functions.iterator(); i.hasNext();) {
            FunctionInformation fi = (FunctionInformation) i.next();
            System.out.println(fi.getName());
            m.put(fi.getName(), fi);
        }

        for (Iterator i = functionProviders.iterator(); i.hasNext();) {
            FunctionProvider fp = (FunctionProvider) i.next();
            FunctionInformation[] fis = fp.getFunctions();
            if (fis != null) {
                for (int j = 0; j < fis.length; j++) {
                    System.out.println(fis[j].getName());
                    m.put(fis[j].getName(), fis[j]);
                }
            }
        }

        for (Iterator i = m.keySet().iterator(); i.hasNext();) {
            FunctionInformation fi = (FunctionInformation) m.get(i.next());
            if (category != null && fi.getCategory() == null) {
                fi.setCategory(category);
            }
            c.add(fi.encode());
        }

        return c.toXLoper();
    }
View Full Code Here

Examples of org.boris.xlloop.util.XLList

public class EchoHandler implements IFunctionHandler
{
    private int count;

    public XLoper execute(IFunctionContext context, String name, XLoper[] args) throws RequestException {
        XLList l = new XLList(args);
        l.add(++count);
        return l.toXLoper();
    }
View Full Code Here

Examples of org.boris.xlloop.util.XLList

                    x.set(i, j, i * j);
                }
            }
            return x;
        } else if (name.equals("ArgsTest")) {
            return new XLList(args).toXLoper();
        } else if (name.equals("BasicTypes")) {
            XLList l = new XLList();
            l.add(34.5);
            l.add(65);
            l.add("hello");
            l.add(XLError.xlTypeMissing);
            l.add(true);
            l.add(false);
            l.add(-1000);
            XLList p = new XLList();
            p.add(123.1213);
            p.add(234234.232);
            p.add(23.3333);
            l.add(p.toXLoper());
            return l.toXLoper();
        } else if (name.equals("Test222")) {
            XLList l = new XLList();
            l.add("m7EA7PaA3COwyuxoVk1YcVvANJjz0g");
            XLList n = new XLList();
            n.add(XLNil.NIL);
            n.add(XLNil.NIL);
            l.add(n.toXLoper());
            l.add(363.51324173151755);
            l.add(false);
            return l.toXLoper();

        } else if (name.equals("MakeRandomString")) {
View Full Code Here

Examples of org.boris.xlloop.util.XLList

        }
    }

    private static void initializeSession(Session session, XLoper[] args) {
        session.init = true;
        XLList l = new XLList(args);
        int size = l.size();
        switch (size) {
        default:
        case 3:
            session.key = l.getString(2);
        case 2:
            session.host = l.getString(1);
        case 1:
            session.user = l.getString(0);
        case 0:
            break;
        }
    }
View Full Code Here

Examples of org.boris.xlloop.util.XLList

public class MenuCodec
{
    public static XLoper toXLoper(Menu menu) {
        XLMap m = new XLMap();
        XLList items = new XLList();
        XLList subs = new XLList();
        for (int i = 0; i < menu.getItemCount(); i++) {
            items.add(toXLoper(menu.getItem(i)));
        }
        for (int i = 0; i < menu.getSubMenuCount(); i++) {
            subs.add(toXLoper(menu.getSubMenu(i)));
        }
        m.add("name", menu.getName());
        m.add("items", items);
        m.add("submenus", subs);
        return m.toXloper();
View Full Code Here

Examples of org.boris.xlloop.util.XLList

        return m.toXloper();
    }

    public static XLoper toXLoper(SubMenu menu) {
        XLMap m = new XLMap();
        XLList items = new XLList();
        for (int i = 0; i < menu.size(); i++) {
            items.add(toXLoper(menu.get(i)));
        }

        m.add("name", menu.getName());
        if (menu.getPosition() != null)
            m.add("position", menu.getPosition());
View Full Code Here

Examples of org.boris.xlloop.util.XLList

        ScriptRepository rep = new ScriptRepository(new File(
                "F:\\eclipse\\workspace\\org.boris.functionserver\\functions"), "Script.");

        Thread.sleep(1000);

        XLList a = new XLList();
        a.add(4);
        a.add(4.5);
        XLoper res = rep.execute(null, "Script.sum", a.toArray());
        System.out.println(res);
    }
View Full Code Here

Examples of org.boris.xlloop.util.XLList

    public static void main(String[] args) throws Exception {
        RequestExecutor re = new RequestExecutor(InetAddress.getLocalHost(), 5454);

        long t0 = System.currentTimeMillis();
        for (int i = 0; i < 10; i++) {
            XLList er = new XLList();
            er.add(1);
            er.add(i);
            er.add(i);
            er.add(i);
            er.add(i);
            er.add(i);
            er.add(i);
            er.add(i);
            er.add(i);
            er.add(i);
            er.add(i);
            er.add(i);
            er.add(i);
            er.add(i);
            er.add(i);
            er.add(i);
            er.add(i);
            XLoper v = re.execute("Echo", er.toXLoper().array);
            System.out.println(v);
        }
        System.out.println(System.currentTimeMillis() - t0);

        re.disconnect();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.