Package com.volantis.xml.expression.atomic.temporal

Examples of com.volantis.xml.expression.atomic.temporal.DurationValue


            } else if ((left instanceof IntValue) && (right instanceof IntValue)) {
                result = operator.compute((IntValue)left, (IntValue)right);
            } else if ((right instanceof DurationValue) &&
                    (operator instanceof TemporalOperator)) {
                TemporalOperator temporalOperator = (TemporalOperator)operator;
                DurationValue durationValue = (DurationValue)right;
                if (left instanceof DateTimeValue) {
                    result = temporalOperator.compute((DateTimeValue)left, durationValue);
                } else if (left instanceof DurationValue) {
                    result = temporalOperator.compute((DurationValue)left, durationValue);
                } else if (left instanceof DateValue) {
View Full Code Here


     *
     * @throws Exception thrown by tested function
     */
    public void testYearsFromDuration() throws Exception {
        final Function function = new YearsFromDurationFunction();
        DurationValue duration;
        Value result;

        duration =
                factory.createDurationValue(true, 20, 15, 0, 0, 0, 0, 0);
        result = function.invoke(
View Full Code Here

     *
     * @throws Exception thrown by tested function
     */
    public void testMonthsFromDuration() throws Exception {
        final Function function = new MonthsFromDurationFunction();
        DurationValue duration;
        Value result;

        duration =
                factory.createDurationValue(true, 20, 15, 0, 0, 0, 0, 0);
        result = function.invoke(
View Full Code Here

     *
     * @throws Exception thrown by tested function
     */
    public void testDaysFromDuration() throws Exception {
        final Function function = new DaysFromDurationFunction();
        DurationValue duration;
        Value result;

        duration =
                factory.createDurationValue(true, 0, 0, 3, 10, 0, 0, 0);
        result = function.invoke(
View Full Code Here

     *
     * @throws Exception thrown by tested function
     */
    public void testHoursFromDuration() throws Exception {
        final Function function = new HoursFromDurationFunction();
        DurationValue duration;
        Value result;

        duration =
                factory.createDurationValue(true, 0, 0, 3, 10, 0, 0, 0);
        result = function.invoke(
View Full Code Here

     *
     * @throws Exception thrown by tested function
     */
    public void testMinutesFromDuration() throws Exception {
        final Function function = new MinutesFromDurationFunction();
        DurationValue duration;
        Value result;

        duration =
                factory.createDurationValue(true, 0, 0, 3, 10, 0, 0, 0);
        result = function.invoke(
View Full Code Here

     *
     * @throws Exception thrown by tested function
     */
    public void testSecondsFromDuration() throws Exception {
        final Function function = new SecondsFromDurationFunction();
        DurationValue duration;
        Value result;

        duration =
                factory.createDurationValue(true, 0, 0, 3, 10, 0, 12, 5);
        result = function.invoke(
View Full Code Here

        if (arguments.length == 0) {
            result = Sequence.EMPTY;
        } else {
            ExpressionFactory factory = context.getFactory();

            DurationValue duration = factory.createDurationValue(
                    arguments[0].stringValue().asJavaString());
            result = getValue(factory, duration);
        }
        return result;
    }
View Full Code Here

                                    new Integer(arguments.length)}));
        }
       
        Value result = Sequence.EMPTY;
        if (arguments[0].getSequence() != Sequence.EMPTY) {
            DurationValue duration = context.getFactory().createDurationValue(
                    arguments[0].stringValue().asJavaString());
            DateTimeValue dateTime = CurrentDateTimeHelper
                    .getCurrentDateTimeValue(context);
            DateTimeValue newDateTime = ((SimpleDateTimeValue) dateTime)
                    .add(duration);
View Full Code Here

TOP

Related Classes of com.volantis.xml.expression.atomic.temporal.DurationValue

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.