incubator-vxquery-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prest...@apache.org
Subject svn commit: r1382219 - /incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/
Date Sat, 08 Sep 2012 00:25:02 GMT
Author: prestonc
Date: Sat Sep  8 00:25:01 2012
New Revision: 1382219

URL: http://svn.apache.org/viewvc?rev=1382219&view=rev
Log:
Removed static pointables. They were a bad idea.

Modified:
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/AbstractValueFromDateTimeScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/AbstractValueFromDurationScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnDateTimeScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnDayFromDateScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnDayFromDateTimeScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnHoursFromDateTimeScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnHoursFromTimeScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMinutesFromDateTimeScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMinutesFromTimeScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMonthFromDateScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMonthFromDateTimeScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnSecondsFromDateTimeScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnSecondsFromTimeScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnTimezoneFromDateScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnTimezoneFromDateTimeScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnTimezoneFromTimeScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnYearFromDateScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnYearFromDateTimeScalarEvaluatorFactory.java

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/AbstractValueFromDateTimeScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/AbstractValueFromDateTimeScalarEvaluatorFactory.java?rev=1382219&r1=1382218&r2=1382219&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/AbstractValueFromDateTimeScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/AbstractValueFromDateTimeScalarEvaluatorFactory.java
Sat Sep  8 00:25:01 2012
@@ -3,10 +3,10 @@ package org.apache.vxquery.runtime.funct
 import java.io.DataOutput;
 import java.io.IOException;
 
+import org.apache.vxquery.datamodel.accessors.SequencePointable;
 import org.apache.vxquery.datamodel.accessors.TaggedValuePointable;
-import org.apache.vxquery.datamodel.api.ITimezone;
-import org.apache.vxquery.datamodel.util.DateTime;
 import org.apache.vxquery.datamodel.values.ValueTag;
+import org.apache.vxquery.datamodel.values.XDMConstants;
 import org.apache.vxquery.exceptions.ErrorCode;
 import org.apache.vxquery.exceptions.SystemException;
 import org.apache.vxquery.runtime.functions.base.AbstractTaggedValueArgumentScalarEvaluator;
@@ -32,11 +32,19 @@ public abstract class AbstractValueFromD
             throws AlgebricksException {
         final ArrayBackedValueStorage abvsInner = new ArrayBackedValueStorage();
         final DataOutput dOutInner = abvsInner.getDataOutput();
+        final SequencePointable seqp = (SequencePointable) SequencePointable.FACTORY.createPointable();
 
         return new AbstractTaggedValueArgumentScalarEvaluator(args) {
             @Override
             protected void evaluate(TaggedValuePointable[] args, IPointable result) throws
SystemException {
                 TaggedValuePointable tvp1 = args[0];
+                if (tvp1.getTag() == ValueTag.SEQUENCE_TAG) {
+                    tvp1.getValue(seqp);
+                    if (seqp.getEntryCount() == 0) {
+                        XDMConstants.setEmptySequence(result);
+                        return;
+                    }
+                }
                 if (tvp1.getTag() != getInputTag()) {
                     throw new SystemException(ErrorCode.FORG0006);
                 }
@@ -46,14 +54,14 @@ public abstract class AbstractValueFromD
                     switch (getReturnTag()) {
                         case ValueTag.XS_INTEGER_TAG:
                             dOutInner.write(ValueTag.XS_INTEGER_TAG);
-                            dOutInner.writeLong(getInteger(tvp1));
+                            dOutInner.writeLong(getValueAsInteger(tvp1));
                             break;
                         case ValueTag.XS_DAY_TIME_DURATION_TAG:
                             dOutInner.write(ValueTag.XS_DAY_TIME_DURATION_TAG);
-                            dOutInner.writeLong(getInteger(tvp1));
+                            dOutInner.writeLong(getValueAsInteger(tvp1));
                             break;
                         case ValueTag.XS_DECIMAL_TAG:
-                            long value = getInteger(tvp1);
+                            long value = getValueAsInteger(tvp1);
                             long decimalPlace = 3;
 
                             // Normalize to decimal.
@@ -88,11 +96,6 @@ public abstract class AbstractValueFromD
         return ValueTag.XS_INTEGER_TAG;
     }
 
-    protected abstract long getInteger(TaggedValuePointable tvp);
-
-    protected long getTimezone(ITimezone timezonep) {
-        return timezonep.getTimezoneHour() * DateTime.CHRONON_OF_HOUR + timezonep.getTimezoneMinute()
-                * DateTime.CHRONON_OF_MINUTE;
-    }
+    protected abstract long getValueAsInteger(TaggedValuePointable tvp);
 
 }

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/AbstractValueFromDurationScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/AbstractValueFromDurationScalarEvaluatorFactory.java?rev=1382219&r1=1382218&r2=1382219&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/AbstractValueFromDurationScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/AbstractValueFromDurationScalarEvaluatorFactory.java
Sat Sep  8 00:25:01 2012
@@ -3,9 +3,11 @@ package org.apache.vxquery.runtime.funct
 import java.io.DataOutput;
 import java.io.IOException;
 
+import org.apache.vxquery.datamodel.accessors.SequencePointable;
 import org.apache.vxquery.datamodel.accessors.TaggedValuePointable;
 import org.apache.vxquery.datamodel.accessors.atomic.XSDurationPointable;
 import org.apache.vxquery.datamodel.values.ValueTag;
+import org.apache.vxquery.datamodel.values.XDMConstants;
 import org.apache.vxquery.exceptions.ErrorCode;
 import org.apache.vxquery.exceptions.SystemException;
 import org.apache.vxquery.runtime.functions.base.AbstractTaggedValueArgumentScalarEvaluator;
@@ -34,6 +36,7 @@ public abstract class AbstractValueFromD
         final XSDurationPointable durationp = (XSDurationPointable) XSDurationPointable.FACTORY.createPointable();
         final LongPointable longp = (LongPointable) LongPointable.FACTORY.createPointable();
         final IntegerPointable intp = (IntegerPointable) IntegerPointable.FACTORY.createPointable();
+        final SequencePointable seqp = (SequencePointable) SequencePointable.FACTORY.createPointable();
         final ArrayBackedValueStorage abvsInner = new ArrayBackedValueStorage();
         final DataOutput dOutInner = abvsInner.getDataOutput();
 
@@ -45,6 +48,13 @@ public abstract class AbstractValueFromD
                 long YMDuration = 0, DTDuration = 0;
 
                 switch (tvp1.getTag()) {
+                    case ValueTag.SEQUENCE_TAG:
+                        tvp1.getValue(seqp);
+                        if (seqp.getEntryCount() == 0) {
+                            XDMConstants.setEmptySequence(result);
+                            return;
+                        }
+                        break;
                     case ValueTag.XS_DURATION_TAG:
                         tvp1.getValue(durationp);
                         YMDuration = durationp.getYearMonth();

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnDateTimeScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnDateTimeScalarEvaluatorFactory.java?rev=1382219&r1=1382218&r2=1382219&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnDateTimeScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnDateTimeScalarEvaluatorFactory.java
Sat Sep  8 00:25:01 2012
@@ -3,11 +3,14 @@ package org.apache.vxquery.runtime.funct
 import java.io.DataOutput;
 import java.io.IOException;
 
+import org.apache.vxquery.datamodel.accessors.SequencePointable;
 import org.apache.vxquery.datamodel.accessors.TaggedValuePointable;
 import org.apache.vxquery.datamodel.accessors.atomic.XSDatePointable;
+import org.apache.vxquery.datamodel.accessors.atomic.XSDateTimePointable;
 import org.apache.vxquery.datamodel.accessors.atomic.XSTimePointable;
 import org.apache.vxquery.datamodel.util.DateTime;
 import org.apache.vxquery.datamodel.values.ValueTag;
+import org.apache.vxquery.datamodel.values.XDMConstants;
 import org.apache.vxquery.exceptions.ErrorCode;
 import org.apache.vxquery.exceptions.SystemException;
 import org.apache.vxquery.runtime.functions.base.AbstractTaggedValueArgumentScalarEvaluator;
@@ -32,6 +35,7 @@ public class FnDateTimeScalarEvaluatorFa
             throws AlgebricksException {
         final XSDatePointable datep = (XSDatePointable) XSDatePointable.FACTORY.createPointable();
         final XSTimePointable timep = (XSTimePointable) XSTimePointable.FACTORY.createPointable();
+        final SequencePointable seqp = (SequencePointable) SequencePointable.FACTORY.createPointable();
         final ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
         final DataOutput dOut = abvs.getDataOutput();
 
@@ -39,12 +43,26 @@ public class FnDateTimeScalarEvaluatorFa
             @Override
             protected void evaluate(TaggedValuePointable[] args, IPointable result) throws
SystemException {
                 TaggedValuePointable tvp1 = args[0];
+                if (tvp1.getTag() == ValueTag.SEQUENCE_TAG) {
+                    tvp1.getValue(seqp);
+                    if (seqp.getEntryCount() == 0) {
+                        XDMConstants.setEmptySequence(result);
+                        return;
+                    }
+                }
                 if (tvp1.getTag() != ValueTag.XS_DATE_TAG) {
                     throw new SystemException(ErrorCode.FORG0006);
                 }
                 tvp1.getValue(datep);
 
                 TaggedValuePointable tvp2 = args[1];
+                if (tvp2.getTag() == ValueTag.SEQUENCE_TAG) {
+                    tvp2.getValue(seqp);
+                    if (seqp.getEntryCount() == 0) {
+                        XDMConstants.setEmptySequence(result);
+                        return;
+                    }
+                }
                 if (tvp2.getTag() != ValueTag.XS_TIME_TAG) {
                     throw new SystemException(ErrorCode.FORG0006);
                 }
@@ -93,7 +111,8 @@ public class FnDateTimeScalarEvaluatorFa
                     dOut.write(timezoneHour);
                     dOut.write(timezoneMinute);
 
-                    result.set(abvs);
+                    result.set(abvs.getByteArray(), abvs.getStartOffset(),
+                            XSDateTimePointable.TYPE_TRAITS.getFixedLength() + 1);
                 } catch (IOException e) {
                     throw new SystemException(ErrorCode.SYSE0001, e);
                 }

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnDayFromDateScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnDayFromDateScalarEvaluatorFactory.java?rev=1382219&r1=1382218&r2=1382219&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnDayFromDateScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnDayFromDateScalarEvaluatorFactory.java
Sat Sep  8 00:25:01 2012
@@ -8,7 +8,6 @@ import edu.uci.ics.hyracks.algebricks.ru
 
 public class FnDayFromDateScalarEvaluatorFactory extends AbstractValueFromDateTimeScalarEvaluatorFactory
{
     private static final long serialVersionUID = 1L;
-    private static final XSDatePointable datep = (XSDatePointable) XSDatePointable.FACTORY.createPointable();
 
     public FnDayFromDateScalarEvaluatorFactory(IScalarEvaluatorFactory[] args) {
         super(args);
@@ -20,7 +19,8 @@ public class FnDayFromDateScalarEvaluato
     }
 
     @Override
-    protected long getInteger(TaggedValuePointable tvp) {
+    protected long getValueAsInteger(TaggedValuePointable tvp) {
+        XSDatePointable datep = (XSDatePointable) XSDatePointable.FACTORY.createPointable();
         tvp.getValue(datep);
         return datep.getDay();
     }

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnDayFromDateTimeScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnDayFromDateTimeScalarEvaluatorFactory.java?rev=1382219&r1=1382218&r2=1382219&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnDayFromDateTimeScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnDayFromDateTimeScalarEvaluatorFactory.java
Sat Sep  8 00:25:01 2012
@@ -8,8 +8,6 @@ import edu.uci.ics.hyracks.algebricks.ru
 
 public class FnDayFromDateTimeScalarEvaluatorFactory extends AbstractValueFromDateTimeScalarEvaluatorFactory
{
     private static final long serialVersionUID = 1L;
-    private static final XSDateTimePointable datetimep = (XSDateTimePointable) XSDateTimePointable.FACTORY
-            .createPointable();
 
     public FnDayFromDateTimeScalarEvaluatorFactory(IScalarEvaluatorFactory[] args) {
         super(args);
@@ -21,7 +19,8 @@ public class FnDayFromDateTimeScalarEval
     }
 
     @Override
-    protected long getInteger(TaggedValuePointable tvp) {
+    protected long getValueAsInteger(TaggedValuePointable tvp) {
+        XSDateTimePointable datetimep = (XSDateTimePointable) XSDateTimePointable.FACTORY.createPointable();
         tvp.getValue(datetimep);
         return datetimep.getDay();
     }

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnHoursFromDateTimeScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnHoursFromDateTimeScalarEvaluatorFactory.java?rev=1382219&r1=1382218&r2=1382219&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnHoursFromDateTimeScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnHoursFromDateTimeScalarEvaluatorFactory.java
Sat Sep  8 00:25:01 2012
@@ -8,8 +8,6 @@ import edu.uci.ics.hyracks.algebricks.ru
 
 public class FnHoursFromDateTimeScalarEvaluatorFactory extends AbstractValueFromDateTimeScalarEvaluatorFactory
{
     private static final long serialVersionUID = 1L;
-    private static final XSDateTimePointable datetimep = (XSDateTimePointable) XSDateTimePointable.FACTORY
-            .createPointable();
 
     public FnHoursFromDateTimeScalarEvaluatorFactory(IScalarEvaluatorFactory[] args) {
         super(args);
@@ -21,7 +19,8 @@ public class FnHoursFromDateTimeScalarEv
     }
 
     @Override
-    protected long getInteger(TaggedValuePointable tvp) {
+    protected long getValueAsInteger(TaggedValuePointable tvp) {
+        XSDateTimePointable datetimep = (XSDateTimePointable) XSDateTimePointable.FACTORY.createPointable();
         tvp.getValue(datetimep);
         return datetimep.getHour();
     }

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnHoursFromTimeScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnHoursFromTimeScalarEvaluatorFactory.java?rev=1382219&r1=1382218&r2=1382219&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnHoursFromTimeScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnHoursFromTimeScalarEvaluatorFactory.java
Sat Sep  8 00:25:01 2012
@@ -8,7 +8,6 @@ import edu.uci.ics.hyracks.algebricks.ru
 
 public class FnHoursFromTimeScalarEvaluatorFactory extends AbstractValueFromDateTimeScalarEvaluatorFactory
{
     private static final long serialVersionUID = 1L;
-    private static final XSTimePointable timep = (XSTimePointable) XSTimePointable.FACTORY.createPointable();
 
     public FnHoursFromTimeScalarEvaluatorFactory(IScalarEvaluatorFactory[] args) {
         super(args);
@@ -20,7 +19,8 @@ public class FnHoursFromTimeScalarEvalua
     }
 
     @Override
-    protected long getInteger(TaggedValuePointable tvp) {
+    protected long getValueAsInteger(TaggedValuePointable tvp) {
+        XSTimePointable timep = (XSTimePointable) XSTimePointable.FACTORY.createPointable();
         tvp.getValue(timep);
         return timep.getHour();
     }

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMinutesFromDateTimeScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMinutesFromDateTimeScalarEvaluatorFactory.java?rev=1382219&r1=1382218&r2=1382219&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMinutesFromDateTimeScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMinutesFromDateTimeScalarEvaluatorFactory.java
Sat Sep  8 00:25:01 2012
@@ -8,8 +8,6 @@ import edu.uci.ics.hyracks.algebricks.ru
 
 public class FnMinutesFromDateTimeScalarEvaluatorFactory extends AbstractValueFromDateTimeScalarEvaluatorFactory
{
     private static final long serialVersionUID = 1L;
-    private static final XSDateTimePointable datetimep = (XSDateTimePointable) XSDateTimePointable.FACTORY
-            .createPointable();
 
     public FnMinutesFromDateTimeScalarEvaluatorFactory(IScalarEvaluatorFactory[] args) {
         super(args);
@@ -21,7 +19,8 @@ public class FnMinutesFromDateTimeScalar
     }
 
     @Override
-    protected long getInteger(TaggedValuePointable tvp) {
+    protected long getValueAsInteger(TaggedValuePointable tvp) {
+        XSDateTimePointable datetimep = (XSDateTimePointable) XSDateTimePointable.FACTORY.createPointable();
         tvp.getValue(datetimep);
         return datetimep.getMinute();
     }

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMinutesFromTimeScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMinutesFromTimeScalarEvaluatorFactory.java?rev=1382219&r1=1382218&r2=1382219&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMinutesFromTimeScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMinutesFromTimeScalarEvaluatorFactory.java
Sat Sep  8 00:25:01 2012
@@ -8,7 +8,6 @@ import edu.uci.ics.hyracks.algebricks.ru
 
 public class FnMinutesFromTimeScalarEvaluatorFactory extends AbstractValueFromDateTimeScalarEvaluatorFactory
{
     private static final long serialVersionUID = 1L;
-    private static final XSTimePointable timep = (XSTimePointable) XSTimePointable.FACTORY.createPointable();
 
     public FnMinutesFromTimeScalarEvaluatorFactory(IScalarEvaluatorFactory[] args) {
         super(args);
@@ -20,7 +19,8 @@ public class FnMinutesFromTimeScalarEval
     }
 
     @Override
-    protected long getInteger(TaggedValuePointable tvp) {
+    protected long getValueAsInteger(TaggedValuePointable tvp) {
+        XSTimePointable timep = (XSTimePointable) XSTimePointable.FACTORY.createPointable();
         tvp.getValue(timep);
         return timep.getMinute();
     }

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMonthFromDateScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMonthFromDateScalarEvaluatorFactory.java?rev=1382219&r1=1382218&r2=1382219&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMonthFromDateScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMonthFromDateScalarEvaluatorFactory.java
Sat Sep  8 00:25:01 2012
@@ -8,7 +8,6 @@ import edu.uci.ics.hyracks.algebricks.ru
 
 public class FnMonthFromDateScalarEvaluatorFactory extends AbstractValueFromDateTimeScalarEvaluatorFactory
{
     private static final long serialVersionUID = 1L;
-    private static final XSDatePointable datep = (XSDatePointable) XSDatePointable.FACTORY.createPointable();
 
     public FnMonthFromDateScalarEvaluatorFactory(IScalarEvaluatorFactory[] args) {
         super(args);
@@ -20,7 +19,8 @@ public class FnMonthFromDateScalarEvalua
     }
 
     @Override
-    protected long getInteger(TaggedValuePointable tvp) {
+    protected long getValueAsInteger(TaggedValuePointable tvp) {
+        XSDatePointable datep = (XSDatePointable) XSDatePointable.FACTORY.createPointable();
         tvp.getValue(datep);
         return datep.getMonth();
     }

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMonthFromDateTimeScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMonthFromDateTimeScalarEvaluatorFactory.java?rev=1382219&r1=1382218&r2=1382219&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMonthFromDateTimeScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnMonthFromDateTimeScalarEvaluatorFactory.java
Sat Sep  8 00:25:01 2012
@@ -8,8 +8,6 @@ import edu.uci.ics.hyracks.algebricks.ru
 
 public class FnMonthFromDateTimeScalarEvaluatorFactory extends AbstractValueFromDateTimeScalarEvaluatorFactory
{
     private static final long serialVersionUID = 1L;
-    private static final XSDateTimePointable datetimep = (XSDateTimePointable) XSDateTimePointable.FACTORY
-            .createPointable();
 
     public FnMonthFromDateTimeScalarEvaluatorFactory(IScalarEvaluatorFactory[] args) {
         super(args);
@@ -21,7 +19,8 @@ public class FnMonthFromDateTimeScalarEv
     }
 
     @Override
-    protected long getInteger(TaggedValuePointable tvp) {
+    protected long getValueAsInteger(TaggedValuePointable tvp) {
+        XSDateTimePointable datetimep = (XSDateTimePointable) XSDateTimePointable.FACTORY.createPointable();
         tvp.getValue(datetimep);
         return datetimep.getMonth();
     }

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnSecondsFromDateTimeScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnSecondsFromDateTimeScalarEvaluatorFactory.java?rev=1382219&r1=1382218&r2=1382219&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnSecondsFromDateTimeScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnSecondsFromDateTimeScalarEvaluatorFactory.java
Sat Sep  8 00:25:01 2012
@@ -8,8 +8,6 @@ import edu.uci.ics.hyracks.algebricks.ru
 
 public class FnSecondsFromDateTimeScalarEvaluatorFactory extends AbstractValueFromDateTimeScalarEvaluatorFactory
{
     private static final long serialVersionUID = 1L;
-    private static final XSDateTimePointable datetimep = (XSDateTimePointable) XSDateTimePointable.FACTORY
-            .createPointable();
 
     public FnSecondsFromDateTimeScalarEvaluatorFactory(IScalarEvaluatorFactory[] args) {
         super(args);
@@ -26,7 +24,8 @@ public class FnSecondsFromDateTimeScalar
     }
 
     @Override
-    protected long getInteger(TaggedValuePointable tvp) {
+    protected long getValueAsInteger(TaggedValuePointable tvp) {
+        XSDateTimePointable datetimep = (XSDateTimePointable) XSDateTimePointable.FACTORY.createPointable();
         tvp.getValue(datetimep);
         return datetimep.getMilliSecond();
     }

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnSecondsFromTimeScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnSecondsFromTimeScalarEvaluatorFactory.java?rev=1382219&r1=1382218&r2=1382219&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnSecondsFromTimeScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnSecondsFromTimeScalarEvaluatorFactory.java
Sat Sep  8 00:25:01 2012
@@ -8,7 +8,6 @@ import edu.uci.ics.hyracks.algebricks.ru
 
 public class FnSecondsFromTimeScalarEvaluatorFactory extends AbstractValueFromDateTimeScalarEvaluatorFactory
{
     private static final long serialVersionUID = 1L;
-    private static final XSTimePointable timep = (XSTimePointable) XSTimePointable.FACTORY.createPointable();
 
     public FnSecondsFromTimeScalarEvaluatorFactory(IScalarEvaluatorFactory[] args) {
         super(args);
@@ -25,7 +24,8 @@ public class FnSecondsFromTimeScalarEval
     }
 
     @Override
-    protected long getInteger(TaggedValuePointable tvp) {
+    protected long getValueAsInteger(TaggedValuePointable tvp) {
+        XSTimePointable timep = (XSTimePointable) XSTimePointable.FACTORY.createPointable();
         tvp.getValue(timep);
         return timep.getMilliSecond();
     }

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnTimezoneFromDateScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnTimezoneFromDateScalarEvaluatorFactory.java?rev=1382219&r1=1382218&r2=1382219&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnTimezoneFromDateScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnTimezoneFromDateScalarEvaluatorFactory.java
Sat Sep  8 00:25:01 2012
@@ -3,12 +3,12 @@ package org.apache.vxquery.runtime.funct
 import org.apache.vxquery.datamodel.accessors.TaggedValuePointable;
 import org.apache.vxquery.datamodel.accessors.atomic.XSDatePointable;
 import org.apache.vxquery.datamodel.values.ValueTag;
+import org.apache.vxquery.runtime.functions.util.FunctionHelper;
 
 import edu.uci.ics.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
 
 public class FnTimezoneFromDateScalarEvaluatorFactory extends AbstractValueFromDateTimeScalarEvaluatorFactory
{
     private static final long serialVersionUID = 1L;
-    private static final XSDatePointable datep = (XSDatePointable) XSDatePointable.FACTORY.createPointable();
 
     public FnTimezoneFromDateScalarEvaluatorFactory(IScalarEvaluatorFactory[] args) {
         super(args);
@@ -25,8 +25,9 @@ public class FnTimezoneFromDateScalarEva
     }
 
     @Override
-    protected long getInteger(TaggedValuePointable tvp) {
+    protected long getValueAsInteger(TaggedValuePointable tvp) {
+        XSDatePointable datep = (XSDatePointable) XSDatePointable.FACTORY.createPointable();
         tvp.getValue(datep);
-        return getTimezone(datep);
+        return FunctionHelper.getTimezone(datep);
     }
 }

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnTimezoneFromDateTimeScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnTimezoneFromDateTimeScalarEvaluatorFactory.java?rev=1382219&r1=1382218&r2=1382219&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnTimezoneFromDateTimeScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnTimezoneFromDateTimeScalarEvaluatorFactory.java
Sat Sep  8 00:25:01 2012
@@ -3,13 +3,12 @@ package org.apache.vxquery.runtime.funct
 import org.apache.vxquery.datamodel.accessors.TaggedValuePointable;
 import org.apache.vxquery.datamodel.accessors.atomic.XSDateTimePointable;
 import org.apache.vxquery.datamodel.values.ValueTag;
+import org.apache.vxquery.runtime.functions.util.FunctionHelper;
 
 import edu.uci.ics.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
 
 public class FnTimezoneFromDateTimeScalarEvaluatorFactory extends AbstractValueFromDateTimeScalarEvaluatorFactory
{
     private static final long serialVersionUID = 1L;
-    private static final XSDateTimePointable datetimep = (XSDateTimePointable) XSDateTimePointable.FACTORY
-            .createPointable();
 
     public FnTimezoneFromDateTimeScalarEvaluatorFactory(IScalarEvaluatorFactory[] args) {
         super(args);
@@ -26,8 +25,9 @@ public class FnTimezoneFromDateTimeScala
     }
 
     @Override
-    protected long getInteger(TaggedValuePointable tvp) {
+    protected long getValueAsInteger(TaggedValuePointable tvp) {
+        XSDateTimePointable datetimep = (XSDateTimePointable) XSDateTimePointable.FACTORY.createPointable();
         tvp.getValue(datetimep);
-        return getTimezone(datetimep);
+        return FunctionHelper.getTimezone(datetimep);
     }
 }

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnTimezoneFromTimeScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnTimezoneFromTimeScalarEvaluatorFactory.java?rev=1382219&r1=1382218&r2=1382219&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnTimezoneFromTimeScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnTimezoneFromTimeScalarEvaluatorFactory.java
Sat Sep  8 00:25:01 2012
@@ -3,12 +3,12 @@ package org.apache.vxquery.runtime.funct
 import org.apache.vxquery.datamodel.accessors.TaggedValuePointable;
 import org.apache.vxquery.datamodel.accessors.atomic.XSTimePointable;
 import org.apache.vxquery.datamodel.values.ValueTag;
+import org.apache.vxquery.runtime.functions.util.FunctionHelper;
 
 import edu.uci.ics.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
 
 public class FnTimezoneFromTimeScalarEvaluatorFactory extends AbstractValueFromDateTimeScalarEvaluatorFactory
{
     private static final long serialVersionUID = 1L;
-    private static final XSTimePointable timep = (XSTimePointable) XSTimePointable.FACTORY.createPointable();
 
     public FnTimezoneFromTimeScalarEvaluatorFactory(IScalarEvaluatorFactory[] args) {
         super(args);
@@ -25,8 +25,9 @@ public class FnTimezoneFromTimeScalarEva
     }
 
     @Override
-    protected long getInteger(TaggedValuePointable tvp) {
+    protected long getValueAsInteger(TaggedValuePointable tvp) {
+        XSTimePointable timep = (XSTimePointable) XSTimePointable.FACTORY.createPointable();
         tvp.getValue(timep);
-        return getTimezone(timep);
+        return FunctionHelper.getTimezone(timep);
     }
 }

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnYearFromDateScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnYearFromDateScalarEvaluatorFactory.java?rev=1382219&r1=1382218&r2=1382219&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnYearFromDateScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnYearFromDateScalarEvaluatorFactory.java
Sat Sep  8 00:25:01 2012
@@ -8,7 +8,6 @@ import edu.uci.ics.hyracks.algebricks.ru
 
 public class FnYearFromDateScalarEvaluatorFactory extends AbstractValueFromDateTimeScalarEvaluatorFactory
{
     private static final long serialVersionUID = 1L;
-    private static final XSDatePointable datep = (XSDatePointable) XSDatePointable.FACTORY.createPointable();
 
     public FnYearFromDateScalarEvaluatorFactory(IScalarEvaluatorFactory[] args) {
         super(args);
@@ -20,7 +19,8 @@ public class FnYearFromDateScalarEvaluat
     }
 
     @Override
-    protected long getInteger(TaggedValuePointable tvp) {
+    protected long getValueAsInteger(TaggedValuePointable tvp) {
+        XSDatePointable datep = (XSDatePointable) XSDatePointable.FACTORY.createPointable();
         tvp.getValue(datep);
         return datep.getYear();
     }

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnYearFromDateTimeScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnYearFromDateTimeScalarEvaluatorFactory.java?rev=1382219&r1=1382218&r2=1382219&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnYearFromDateTimeScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/datetime/FnYearFromDateTimeScalarEvaluatorFactory.java
Sat Sep  8 00:25:01 2012
@@ -8,8 +8,6 @@ import edu.uci.ics.hyracks.algebricks.ru
 
 public class FnYearFromDateTimeScalarEvaluatorFactory extends AbstractValueFromDateTimeScalarEvaluatorFactory
{
     private static final long serialVersionUID = 1L;
-    private static final XSDateTimePointable datetimep = (XSDateTimePointable) XSDateTimePointable.FACTORY
-            .createPointable();
 
     public FnYearFromDateTimeScalarEvaluatorFactory(IScalarEvaluatorFactory[] args) {
         super(args);
@@ -21,7 +19,8 @@ public class FnYearFromDateTimeScalarEva
     }
 
     @Override
-    protected long getInteger(TaggedValuePointable tvp) {
+    protected long getValueAsInteger(TaggedValuePointable tvp) {
+        XSDateTimePointable datetimep = (XSDateTimePointable) XSDateTimePointable.FACTORY.createPointable();
         tvp.getValue(datetimep);
         return datetimep.getYear();
     }



Mime
View raw message