Examples of RippleList


Examples of net.fortytwo.ripple.model.RippleList

    public void apply(final RippleList arg,
                      final Sink<RippleList> solutions,
                      final ModelConnection mc) throws RippleException {

        RippleList stack = arg;

        RippleValue v;

        v = stack.getFirst();
        stack = stack.getRest();

        solutions.put(
                stack.push(mc.valueOf(mc.toString(v), XMLSchema.STRING)));
    }
View Full Code Here

Examples of net.fortytwo.ripple.model.RippleList

    public void apply(final RippleList arg,
                      final Sink<RippleList> solutions,
                      final ModelConnection mc) throws RippleException {

        RippleList stack = arg;

        Value v;

        v = stack.getFirst().toRDF(mc).sesameValue();
        stack = stack.getRest();

        if (v instanceof Literal) {
            URI type = ((Literal) v).getDatatype();

            if (null != type) {
                solutions.put(
                        stack.push(new RDFValue(type)));
            }
        }
    }
View Full Code Here

Examples of net.fortytwo.ripple.model.RippleList

    public void apply(final RippleList arg,
                      final Sink<RippleList> solutions,
                      final ModelConnection mc) throws RippleException {

        RippleList stack = arg;

        URI s;

        s = URI.create(mc.toString(stack.getFirst()));
        stack = stack.getRest();

        RDFValue uri = mc.valueOf(s);

        solutions.put(
                stack.push(uri));
    }
View Full Code Here

Examples of net.fortytwo.ripple.model.RippleList

    public void apply(final RippleList arg,
                      final Sink<RippleList> solutions,
                      final ModelConnection mc) throws RippleException {

        RippleList stack = arg;

        RippleValue a, b, result;

        a = stack.getFirst();
        stack = stack.getRest();
        b = stack.getFirst();
        stack = stack.getRest();

        // Note: equals() is not suitable for this operation (for instance,
        //       it may yield false for RdfValues containing identical
        //       Literals).
        result = mc.valueOf(0 == mc.getComparator().compare(a, b));

        solutions.put(stack.push(result));
    }
View Full Code Here

Examples of net.fortytwo.ripple.model.RippleList

    public void apply(final RippleList arg,
                      final Sink<RippleList> solutions,
                      final ModelConnection mc) throws RippleException {

        RippleList stack = arg;

        String s;

        s = mc.toString(stack.getFirst());
        stack = stack.getRest();

        int i;

        try {
            i = new Integer(s).intValue();
        } catch (NumberFormatException e) {
            logger.fine("bad integer value: " + s);
            return;
        }

        solutions.put(
                stack.push(mc.valueOf(i)));
    }
View Full Code Here

Examples of net.fortytwo.ripple.model.RippleList

    public void apply(final RippleList arg,
                      final Sink<RippleList> solutions,
                      final ModelConnection mc) throws RippleException {

        RippleList stack = arg;

        RippleValue y, x;

        y = stack.getFirst();
        stack = stack.getRest();
        x = stack.getFirst();
        stack = stack.getRest();

        int result = mc.getComparator().compare(x, y);

        // Constrain the result to three possible values.
        result = (result < 0) ? -1 : (result > 0) ? 1 : 0;

        solutions.put(stack.push(mc.valueOf(result)));
    }
View Full Code Here

Examples of net.fortytwo.ripple.model.RippleList

    public void apply(final RippleList arg,
                      final Sink<RippleList> solutions,
                      final ModelConnection mc) throws RippleException {

        RippleList stack = arg;
        Date d = mc.toDateValue(stack.getFirst());
        stack = stack.getRest();

        solutions.put(stack.push(
                mc.valueOf(d.getTime())));
    }
View Full Code Here

Examples of net.fortytwo.ripple.model.RippleList

    public void apply(final RippleList arg,
                      final Sink<RippleList> solutions,
                      final ModelConnection mc) throws RippleException {

        RippleValue a, b, result;
        RippleList stack = arg;

        b = stack.getFirst();
        stack = stack.getRest();
        a = stack.getFirst();
        stack = stack.getRest();

        result = mc.valueOf(mc.getComparator().compare(a, b) < 0);

        solutions.put(
                stack.push(result));
    }
View Full Code Here

Examples of net.fortytwo.ripple.model.RippleList

    public void apply(final RippleList arg,
                      final Sink<RippleList> solutions,
                      final ModelConnection mc) throws RippleException {

        RippleList stack = arg;

        String s;

        s = mc.toString(stack.getFirst());
        stack = stack.getRest();

        double d;

        try {
            d = new Double(s).doubleValue();
        } catch (NumberFormatException e) {
            logger.fine("bad integer value: " + s);
            return;
        }

        solutions.put(
                stack.push(mc.valueOf(d)));
    }
View Full Code Here

Examples of net.fortytwo.ripple.model.RippleList

    public void put(final RippleList stack) throws RippleException {
        // Grab the topmost item on the stack.
        RippleValue subject = stack.getFirst();

        // View the list in right-to-left order
        RippleList list = stack.invert();

        String prefix = "  [" + ++index + "]" + INDEX_SEPARATOR;
        String prefixIndent = "                ".substring(0, prefix.length());
        printStream.print(prefix);
        //printStream.print( "" + ++index + " ->" + INDEX_SEPARATOR );
        //printStream.print( "rdf:_" + ++index + INDEX_SEPARATOR );

        if (printEntireStack) {
            list.printTo(printStream, false);
        } else {
            subject.printTo(printStream);
        }

        printStream.print("\n");
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.