Package edu.uci.ics.hyracks.data.std.util

Examples of edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage


    private final TaggedValuePointable tvp = (TaggedValuePointable) TaggedValuePointable.FACTORY.createPointable();

    public DescendantOrSelfPathStepScalarEvaluator(IScalarEvaluator[] args, IHyracksTaskContext ctx) {
        super(args, ctx);
        rootTVP = (TaggedValuePointable) TaggedValuePointable.FACTORY.createPointable();
        seqAbvs = new ArrayBackedValueStorage();
    }
View Full Code Here


            throws AlgebricksException {
        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();

        return new AbstractTaggedValueArgumentScalarEvaluator(args) {
            @Override
            protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException {
                TaggedValuePointable tvp1 = args[0];
                long value;
                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();
                        DTDuration = durationp.getDayTime();
                        break;
                    case ValueTag.XS_DAY_TIME_DURATION_TAG:
                        tvp1.getValue(longp);
                        DTDuration = longp.getLong();
                        break;
                    case ValueTag.XS_YEAR_MONTH_DURATION_TAG:
                        tvp1.getValue(intp);
                        YMDuration = intp.getInteger();
                        break;
                    default:
                        throw new SystemException(ErrorCode.FORG0006);
                }

                value = convertDuration(YMDuration, DTDuration);

                try {
                    abvsInner.reset();
                    switch (getReturnTag()) {
                        case ValueTag.XS_INTEGER_TAG:
                            dOutInner.write(ValueTag.XS_INTEGER_TAG);
                            dOutInner.writeLong(value);
                            break;
View Full Code Here

    }

    @Override
    protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args)
            throws AlgebricksException {
        final ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
        final SequenceBuilder sb = new SequenceBuilder();
        final SequencePointable seq = (SequencePointable) SequencePointable.FACTORY.createPointable();
        final VoidPointable p = (VoidPointable) VoidPointable.FACTORY.createPointable();
        final LongPointable longp = (LongPointable) LongPointable.FACTORY.createPointable();
        return new AbstractTaggedValueArgumentScalarEvaluator(args) {
            @Override
            protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException {
                try {
                    TaggedValuePointable tvp2 = args[1];
                    if (tvp2.getTag() != ValueTag.XS_INTEGER_TAG) {
                        throw new SystemException(ErrorCode.FORG0006);
                    }
                    tvp2.getValue(longp);

                    abvs.reset();
                    sb.reset(abvs);
                    TaggedValuePointable tvp1 = args[0];
                    if (tvp1.getTag() == ValueTag.SEQUENCE_TAG) {
                        tvp1.getValue(seq);
                        int seqLen = seq.getEntryCount();
View Full Code Here

    }

    @Override
    protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args)
            throws AlgebricksException {
        final ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
        final DataOutput dOut = abvs.getDataOutput();
        final NodeTreePointable ntp = (NodeTreePointable) NodeTreePointable.FACTORY.createPointable();

        return new AbstractTaggedValueArgumentScalarEvaluator(args) {
            @Override
            protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException {
                TaggedValuePointable tvp1 = args[0];
                // Only accept node trees as input.
                try {
                    int localNodeId = FunctionHelper.getLocalNodeId(tvp1);
                    if (localNodeId == -1) {
                        XDMConstants.setEmptySequence(result);
                    } else {
                        tvp1.getValue(ntp);

                        abvs.reset();
                        dOut.write(ValueTag.XS_LONG_TAG);
                        dOut.writeInt(ntp.getRootNodeId());
                        dOut.writeInt(localNodeId);
                        result.set(abvs);
                    }
View Full Code Here

    @Override
    protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args)
            throws AlgebricksException {
        return new AbstractTypeScalarEvaluator(args, ctx) {
            final ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
            final DataOutput dOut = abvs.getDataOutput();
            final FunctionHelper.TypedPointables tp = new FunctionHelper.TypedPointables();
            AbstractCastToOperation aOp = new CastToStringOperation();
            int castToTag = 0;

            @Override
            protected void evaluate(TaggedValuePointable tvp, IPointable result) throws SystemException {
                abvs.reset();
                int tid = tvp.getTag();
                if (castToTag == -1 || castToTag == 0) {
                    // The promote type is not supported. No change.
                    result.set(tvp);
                    return;
                } else if (castToTag > 0) {
                    try {
                        switch (tid) {
                            case ValueTag.XS_ANY_URI_TAG:
                                tvp.getValue(tp.utf8sp);
                                aOp.convertAnyURI(tp.utf8sp, dOut);
                                result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength());
                                break;

                            case ValueTag.XS_BYTE_TAG:
                                tvp.getValue(tp.bytep);
                                aOp.convertByte(tp.bytep, dOut);
                                result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength());
                                break;

                            case ValueTag.XS_DECIMAL_TAG:
                                tvp.getValue(tp.decp);
                                aOp.convertDecimal(tp.decp, dOut);
                                result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength());
                                break;

                            case ValueTag.XS_DOUBLE_TAG:
                                tvp.getValue(tp.doublep);
                                aOp.convertDouble(tp.doublep, dOut);
                                result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength());
                                break;

                            case ValueTag.XS_FLOAT_TAG:
                                tvp.getValue(tp.floatp);
                                aOp.convertFloat(tp.floatp, dOut);
                                result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength());
                                break;

                            case ValueTag.XS_INT_TAG:
                                tvp.getValue(tp.intp);
                                aOp.convertInt(tp.intp, dOut);
                                result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength());
                                break;

                            case ValueTag.XS_INTEGER_TAG:
                                tvp.getValue(tp.longp);
                                aOp.convertInteger(tp.longp, dOut);
                                result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength());
                                break;

                            case ValueTag.XS_LONG_TAG:
                                tvp.getValue(tp.longp);
                                aOp.convertLong(tp.longp, dOut);
                                result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength());
                                break;

                            case ValueTag.XS_NEGATIVE_INTEGER_TAG:
                                tvp.getValue(tp.longp);
                                aOp.convertNegativeInteger(tp.longp, dOut);
                                result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength());
                                break;

                            case ValueTag.XS_NON_NEGATIVE_INTEGER_TAG:
                                tvp.getValue(tp.longp);
                                aOp.convertNonNegativeInteger(tp.longp, dOut);
                                result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength());
                                break;

                            case ValueTag.XS_NON_POSITIVE_INTEGER_TAG:
                                tvp.getValue(tp.longp);
                                aOp.convertNonPositiveInteger(tp.longp, dOut);
                                result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength());
                                break;

                            case ValueTag.XS_POSITIVE_INTEGER_TAG:
                                tvp.getValue(tp.longp);
                                aOp.convertPositiveInteger(tp.longp, dOut);
                                result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength());
                                break;

                            case ValueTag.XS_SHORT_TAG:
                                tvp.getValue(tp.shortp);
                                aOp.convertShort(tp.shortp, dOut);
                                result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength());
                                break;

                            case ValueTag.XS_STRING_TAG:
                                tvp.getValue(tp.utf8sp);
                                aOp.convertString(tp.utf8sp, dOut);
                                result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength());
                                break;

                            case ValueTag.XS_UNSIGNED_BYTE_TAG:
                                tvp.getValue(tp.shortp);
                                aOp.convertUnsignedByte(tp.shortp, dOut);
                                result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength());
                                break;

                            case ValueTag.XS_UNSIGNED_INT_TAG:
                                tvp.getValue(tp.longp);
                                aOp.convertUnsignedInt(tp.longp, dOut);
                                result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength());
                                break;

                            case ValueTag.XS_UNSIGNED_LONG_TAG:
                                tvp.getValue(tp.longp);
                                aOp.convertUnsignedLong(tp.longp, dOut);
                                result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength());
                                break;

                            case ValueTag.XS_UNSIGNED_SHORT_TAG:
                                tvp.getValue(tp.intp);
                                aOp.convertUnsignedShort(tp.intp, dOut);
                                result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength());
                                break;

                            default:
                                // Promote type does not require us to change the value.
                                result.set(tvp);
View Full Code Here

    }

    @Override
    protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args)
            throws AlgebricksException {
        final ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
        final ArrayBackedValueStorage abvsInner = new ArrayBackedValueStorage();
        final DataOutput dOutInner = abvsInner.getDataOutput();
        final SequenceBuilder sb = new SequenceBuilder();
        final LongPointable longp = (LongPointable) LongPointable.FACTORY.createPointable();

        return new AbstractTaggedValueArgumentScalarEvaluator(args) {
            @Override
            protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException {
                try {
                    TaggedValuePointable tvp1 = args[0];
                    if (tvp1.getTag() != ValueTag.XS_INTEGER_TAG) {
                        throw new SystemException(ErrorCode.FORG0006);
                    }
                    tvp1.getValue(longp);
                    long start = longp.getLong();

                    TaggedValuePointable tvp2 = args[1];
                    if (tvp2.getTag() != ValueTag.XS_INTEGER_TAG) {
                        throw new SystemException(ErrorCode.FORG0006);
                    }
                    tvp2.getValue(longp);
                    long end = longp.getLong();

                    abvs.reset();
                    sb.reset(abvs);
                    if (start > end) {
                        XDMConstants.setEmptySequence(result);
                        return;
                    } else {
                        for (long j = start; j <= end; ++j) {
                            abvsInner.reset();
                            dOutInner.write(ValueTag.XS_INTEGER_TAG);
                            dOutInner.writeLong(j);
                            sb.addItem(abvsInner);
                        }
                    }
View Full Code Here

    @Override
    protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args)
            throws AlgebricksException {
        final DynamicContext dCtx = (DynamicContext) ctx.getJobletContext().getGlobalJobData();
        final XSDateTimePointable datetimep = (XSDateTimePointable) XSDateTimePointable.FACTORY.createPointable();
        final ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
        final DataOutput dOut = abvs.getDataOutput();

        return new AbstractTaggedValueArgumentScalarEvaluator(args) {
            @Override
            protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException {
                try {
                    dCtx.getCurrentDateTime(datetimep);
                    long value = datetimep.getTimezoneHour() * DateTime.CHRONON_OF_HOUR + datetimep.getTimezoneMinute()
                            * DateTime.CHRONON_OF_MINUTE;

                    abvs.reset();
                    dOut.write(ValueTag.XS_DAY_TIME_DURATION_TAG);
                    dOut.writeLong(value);
                    result.set(abvs);
                } catch (IOException e) {
                    throw new SystemException(ErrorCode.SYSE0001, e);
View Full Code Here

    }

    @Override
    protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args)
            throws AlgebricksException {
        final ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
        final SequenceBuilder sb = new SequenceBuilder();
        final SequencePointable seq = (SequencePointable) SequencePointable.FACTORY.createPointable();
        final SequencePointable seq2 = (SequencePointable) SequencePointable.FACTORY.createPointable();
        final VoidPointable p = (VoidPointable) VoidPointable.FACTORY.createPointable();
        final LongPointable longp = (LongPointable) LongPointable.FACTORY.createPointable();
        return new AbstractTaggedValueArgumentScalarEvaluator(args) {
            @Override
            protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException {
                try {
                    TaggedValuePointable tvp2 = args[1];
                    if (tvp2.getTag() != ValueTag.XS_INTEGER_TAG) {
                        throw new SystemException(ErrorCode.FORG0006);
                    }
                    tvp2.getValue(longp);

                    abvs.reset();
                    sb.reset(abvs);
                    TaggedValuePointable tvp1 = args[0];
                    TaggedValuePointable tvp3 = args[2];
                    if (tvp1.getTag() == ValueTag.SEQUENCE_TAG) {
                        tvp1.getValue(seq);
View Full Code Here

    protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args)
            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();

        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() != 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);
                }
                tvp2.getValue(timep);

                // Set the timezone.
                byte timezoneHour, timezoneMinute;
                if (datep.getTimezoneHour() == DateTime.TIMEZONE_HOUR_NULL
                        && datep.getTimezoneMinute() == DateTime.TIMEZONE_MINUTE_NULL
                        && timep.getTimezoneHour() == DateTime.TIMEZONE_HOUR_NULL
                        && timep.getTimezoneMinute() == DateTime.TIMEZONE_MINUTE_NULL) {
                    // both null.
                    timezoneHour = DateTime.TIMEZONE_HOUR_NULL;
                    timezoneMinute = DateTime.TIMEZONE_MINUTE_NULL;
                } else if (datep.getTimezoneHour() == DateTime.TIMEZONE_HOUR_NULL
                        && datep.getTimezoneMinute() == DateTime.TIMEZONE_MINUTE_NULL
                        && timep.getTimezoneHour() != DateTime.TIMEZONE_HOUR_NULL
                        && timep.getTimezoneMinute() != DateTime.TIMEZONE_MINUTE_NULL) {
                    // date is null.
                    timezoneHour = (byte) timep.getTimezoneHour();
                    timezoneMinute = (byte) timep.getTimezoneMinute();
                } else if (datep.getTimezoneHour() != DateTime.TIMEZONE_HOUR_NULL
                        && datep.getTimezoneMinute() != DateTime.TIMEZONE_MINUTE_NULL
                        && timep.getTimezoneHour() == DateTime.TIMEZONE_HOUR_NULL
                        && timep.getTimezoneMinute() == DateTime.TIMEZONE_MINUTE_NULL) {
                    // time is null.
                    timezoneHour = (byte) datep.getTimezoneHour();
                    timezoneMinute = (byte) datep.getTimezoneMinute();
                } else if (datep.getTimezoneHour() == timep.getTimezoneHour()
                        && datep.getTimezoneMinute() == timep.getTimezoneMinute()) {
                    // timezones are the same.
                    timezoneHour = (byte) datep.getTimezoneHour();
                    timezoneMinute = (byte) datep.getTimezoneMinute();
                } else {
                    // Neither match.
                    throw new SystemException(ErrorCode.FORG0008);
                }

                try {
                    abvs.reset();
                    dOut.write(ValueTag.XS_DATETIME_TAG);
                    dOut.write(datep.getByteArray(), datep.getStartOffset(),
                            XSDatePointable.TYPE_TRAITS.getFixedLength() - 2);
                    dOut.write(timep.getByteArray(), timep.getStartOffset(),
                            XSTimePointable.TYPE_TRAITS.getFixedLength() - 2);
                    dOut.write(timezoneHour);
                    dOut.write(timezoneMinute);

                    result.set(abvs.getByteArray(), abvs.getStartOffset(),
                            XSDateTimePointable.TYPE_TRAITS.getFixedLength() + 1);
                } catch (IOException e) {
                    throw new SystemException(ErrorCode.SYSE0001, e);
                }
            }
View Full Code Here

    @Override
    protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args)
            throws AlgebricksException {
        final UTF8StringPointable stringp = (UTF8StringPointable) UTF8StringPointable.FACTORY.createPointable();
        final ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
        final ArrayBackedValueStorage abvsInner = new ArrayBackedValueStorage();
        final DataOutput dOutInner = abvsInner.getDataOutput();
        final CastToStringOperation castToString = new CastToStringOperation();
        final FunctionHelper.TypedPointables tp = new FunctionHelper.TypedPointables();

        return new AbstractTaggedValueArgumentScalarEvaluator(args) {
            @Override
            protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException {
                abvs.reset();

                try {
                    // Byte Format: Type (1 byte) + String Byte Length (2 bytes) + String.
                    DataOutput out = abvs.getDataOutput();
                    out.write(ValueTag.XS_STRING_TAG);

                    // Default values for the length and update later
                    out.write(0xFF);
                    out.write(0xFF);

                    for (int i = 0; i < args.length; i++) {
                        TaggedValuePointable tvp = args[i];

                        // TODO Update function to support cast to a string from any atomic value.
                        if (!FunctionHelper.isDerivedFromString(tvp.getTag())) {

                            try {
                                abvsInner.reset();
                                switch (tvp.getTag()) {
                                    case ValueTag.XS_ANY_URI_TAG:
                                        tvp.getValue(tp.utf8sp);
                                        castToString.convertAnyURI(tp.utf8sp, dOutInner);
                                        break;
                                    case ValueTag.XS_UNTYPED_ATOMIC_TAG:
                                        tvp.getValue(tp.utf8sp);
                                        castToString.convertUntypedAtomic(tp.utf8sp, dOutInner);
                                        break;
                                    case ValueTag.XS_BASE64_BINARY_TAG:
                                        tvp.getValue(tp.binaryp);
                                        castToString.convertBase64Binary(tp.binaryp, dOutInner);
                                        break;
                                    case ValueTag.XS_HEX_BINARY_TAG:
                                        tvp.getValue(tp.binaryp);
                                        castToString.convertHexBinary(tp.binaryp, dOutInner);
                                        break;
                                    case ValueTag.XS_BOOLEAN_TAG:
                                        tvp.getValue(tp.boolp);
                                        castToString.convertBoolean(tp.boolp, dOutInner);
                                        break;
                                    case ValueTag.XS_DATETIME_TAG:
                                        tvp.getValue(tp.datetimep);
                                        castToString.convertDatetime(tp.datetimep, dOutInner);
                                        break;
                                    case ValueTag.XS_DAY_TIME_DURATION_TAG:
                                        tvp.getValue(tp.longp);
                                        castToString.convertDTDuration(tp.longp, dOutInner);
                                        break;
                                    case ValueTag.XS_INTEGER_TAG:
                                    case ValueTag.XS_NON_POSITIVE_INTEGER_TAG:
                                    case ValueTag.XS_NEGATIVE_INTEGER_TAG:
                                    case ValueTag.XS_LONG_TAG:
                                    case ValueTag.XS_NON_NEGATIVE_INTEGER_TAG:
                                    case ValueTag.XS_UNSIGNED_LONG_TAG:
                                    case ValueTag.XS_POSITIVE_INTEGER_TAG:
                                    case ValueTag.XS_UNSIGNED_INT_TAG:
                                        tvp.getValue(tp.longp);
                                        castToString.convertInteger(tp.longp, dOutInner);
                                        break;
                                    case ValueTag.XS_DURATION_TAG:
                                        tvp.getValue(tp.durationp);
                                        castToString.convertDuration(tp.durationp, dOutInner);
                                        break;
                                    case ValueTag.XS_DATE_TAG:
                                        tvp.getValue(tp.datep);
                                        castToString.convertDate(tp.datep, dOutInner);
                                        break;
                                    case ValueTag.XS_G_DAY_TAG:
                                        tvp.getValue(tp.datep);
                                        castToString.convertGDay(tp.datep, dOutInner);
                                        break;
                                    case ValueTag.XS_G_MONTH_DAY_TAG:
                                        tvp.getValue(tp.datep);
                                        castToString.convertGMonthDay(tp.datep, dOutInner);
                                        break;
                                    case ValueTag.XS_G_MONTH_TAG:
                                        tvp.getValue(tp.datep);
                                        castToString.convertGMonth(tp.datep, dOutInner);
                                        break;
                                    case ValueTag.XS_G_YEAR_MONTH_TAG:
                                        tvp.getValue(tp.datep);
                                        castToString.convertGYearMonth(tp.datep, dOutInner);
                                        break;
                                    case ValueTag.XS_G_YEAR_TAG:
                                        tvp.getValue(tp.datep);
                                        castToString.convertGYear(tp.datep, dOutInner);
                                        break;
                                    case ValueTag.XS_QNAME_TAG:
                                        tvp.getValue(tp.qnamep);
                                        castToString.convertQName(tp.qnamep, dOutInner);
                                        break;
                                    case ValueTag.XS_TIME_TAG:
                                        tvp.getValue(tp.timep);
                                        castToString.convertTime(tp.timep, dOutInner);
                                        break;
                                    case ValueTag.XS_YEAR_MONTH_DURATION_TAG:
                                        tvp.getValue(tp.intp);
                                        castToString.convertYMDuration(tp.intp, dOutInner);
                                        break;
                                    case ValueTag.XS_INT_TAG:
                                    case ValueTag.XS_UNSIGNED_SHORT_TAG:
                                        tvp.getValue(tp.intp);
                                        castToString.convertInt(tp.intp, dOutInner);
                                        break;
                                    case ValueTag.XS_DECIMAL_TAG:
                                        tvp.getValue(tp.decp);
                                        castToString.convertDecimal(tp.decp, dOutInner);
                                        break;
                                    case ValueTag.XS_DOUBLE_TAG:
                                        tvp.getValue(tp.doublep);
                                        castToString.convertDouble(tp.doublep, dOutInner);
                                        break;
                                    case ValueTag.XS_FLOAT_TAG:
                                        tvp.getValue(tp.floatp);
                                        castToString.convertFloat(tp.floatp, dOutInner);
                                        break;
                                    case ValueTag.XS_SHORT_TAG:
                                    case ValueTag.XS_UNSIGNED_BYTE_TAG:
                                        tvp.getValue(tp.shortp);
                                        castToString.convertShort(tp.shortp, dOutInner);
                                        break;
                                    case ValueTag.XS_BYTE_TAG:
                                        tvp.getValue(tp.bytep);
                                        castToString.convertByte(tp.bytep, dOutInner);
                                        break;
                                    case ValueTag.SEQUENCE_TAG:
                                        tvp.getValue(tp.seqp);
                                        if (tp.seqp.getEntryCount() == 0) {
                                            // Byte Format: Type (1 byte) + String Length (2 bytes) + String.
                                            dOutInner.write(ValueTag.XS_STRING_TAG);
                                            dOutInner.write(0);
                                            dOutInner.write(0);
                                            break;
                                        }
                                        // Pass through if not empty sequence.
                                    default:
                                        throw new SystemException(ErrorCode.XPTY0004);
                                }

                                stringp.set(abvsInner.getByteArray(), abvsInner.getStartOffset() + 1,
                                        abvsInner.getLength() - 1);
                            } catch (IOException e) {
                                throw new SystemException(ErrorCode.SYSE0001, e);
                            }
                        } else {
                            tvp.getValue(stringp);
View Full Code Here

TOP

Related Classes of edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage

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.