Package net.fortytwo.ripple.model

Examples of net.fortytwo.ripple.model.RippleList.push()


        stack = stack.getRest();

        result = mc.valueOf(Math.cbrt(a.doubleValue()));

        solutions.put(
                stack.push(result));
    }

    @Override
    public StackMapping getInverse() {
        return new Cube();
View Full Code Here


            stack = stack.getRest();

            result = a.mul(a).mul(a);

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

        final RippleList rest = stack.getRest();

        Sink<RippleList> listSink = new Sink<RippleList>() {
            public void put(final RippleList list) throws RippleException {
                solutions.put(
                        rest.push(list.push(x)));
            }
        };

        mc.toList(l, listSink);
    }
View Full Code Here

        stack = stack.getRest();

        try {
            result = mc.toString(s).substring(begin, end);
            solutions.put(
                    stack.push(StringLibrary.value(result, mc, s)));
        } catch (IndexOutOfBoundsException e) {
            // Silent fail.
        }
    }
}
View Full Code Here

        final RippleList rest = stack.getRest();

        Sink<Operator> opSink = new Sink<Operator>() {
            public void put(final Operator op) throws RippleException {
                CriterionApplicator applicator = new CriterionApplicator(op);
                solutions.put(rest.push(new Operator(applicator)));
            }
        };

        Operator.createOperator(mapping, opSink, mc);
    }
View Full Code Here

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

        String result = StringUtils.percentEncode(mc.toString(a));
        solutions.put(
                stack.push(StringLibrary.value(result, mc, a)));
    }
}
View Full Code Here

        // Note: mod by zero simply does not yield a result.
        if (!b.isZero()) {
            result = a.mod(b);

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

            RippleList stack = arg;
            Decider decider = new Decider(stack);

            // Apply the criterion, sending the result into the Decider.
            solutions.put(stack.push(criterion).push(new Operator(decider)));
        }
    }

    private class Decider implements StackMapping {
        private RippleList rest;
View Full Code Here

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

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

        for (int i = 0; i < n; i++) {
            if (cur.isNil()) {
                return null;
            }

            inverted = inverted.push(cur.getFirst());
            cur = cur.getRest();
        }

        return inverted.invert();
    }
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.