Package xbird.xquery.operator.math

Examples of xbird.xquery.operator.math.PlusOp.eval()


                    throw new DynamicError("err:FORG0006", "fs:plus(" + sum.getType() + ", "
                            + toadd.getType() + ") is not defined.");
                }
                final PlusOp op = new PlusOp();
                op.staticAnalysis(dynEnv.getStaticContext(), sum, toadd);
                sum = (XNumber) op.eval(dynEnv, sum, toadd);
            }
            final DivOp op = new DivOp();
            final XInteger divby = XInteger.valueOf(size);
            op.staticAnalysis(dynEnv.getStaticContext(), sum, divby);
            return op.eval(dynEnv, sum, divby);
View Full Code Here


                sum = (XNumber) op.eval(dynEnv, sum, toadd);
            }
            final DivOp op = new DivOp();
            final XInteger divby = XInteger.valueOf(size);
            op.staticAnalysis(dynEnv.getStaticContext(), sum, divby);
            return op.eval(dynEnv, sum, divby);
        } else if(firstItem instanceof DurationValue) {
            // Duration values must either all be xdt:yearMonthDuration values
            // or must all be xdt:dayTimeDuration values.
            DurationValue sum = (DurationValue) firstItem;
            Type firstType = firstItem.getType();
View Full Code Here

                    throw new DynamicError("err:FORG0006", "Duration values must all be `"
                            + firstType + "`, but found `" + toadd.getType() + "`");
                }
                final PlusOp op = new PlusOp();
                op.staticAnalysis(dynEnv.getStaticContext(), sum, toadd);
                sum = (DurationValue) op.eval(dynEnv, sum, toadd);
            }
            final DivOp op = new DivOp();
            final XInteger divby = XInteger.valueOf(size);
            op.staticAnalysis(dynEnv.getStaticContext(), sum, divby);
            return op.eval(dynEnv, sum, divby);
View Full Code Here

                sum = (DurationValue) op.eval(dynEnv, sum, toadd);
            }
            final DivOp op = new DivOp();
            final XInteger divby = XInteger.valueOf(size);
            op.staticAnalysis(dynEnv.getStaticContext(), sum, divby);
            return op.eval(dynEnv, sum, divby);
        } else {
            throw new DynamicError("err:FORG0006", "Invalid argument type: " + firstItem.getType());
        }
    }
View Full Code Here

                            + toadd.getType() + ") is not defined.");
                }
                // TODO more efficient processing
                final PlusOp op = new PlusOp();
                op.staticAnalysis(dynEnv.getStaticContext(), sum, toadd);
                sum = (XNumber) op.eval(dynEnv, sum, toadd);
            }
            return sum;
        } else if(firstItem instanceof DurationValue) {
            // Duration values must either all be xdt:yearMonthDuration values
            // or must all be xdt:dayTimeDuration values.
View Full Code Here

                    throw new DynamicError("err:FORG0006", "Duration values must all be `"
                            + firstType + "`, but found `" + toadd.getType() + "`");
                }
                final PlusOp op = new PlusOp();
                op.staticAnalysis(dynEnv.getStaticContext(), sum, toadd);
                sum = (DurationValue) op.eval(dynEnv, sum, toadd);
            }
            return sum;
        } else {
            throw new DynamicError("err:FORG0006", "Invalid argument type: " + firstItem.getType());
        }
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.