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

Examples of edu.uci.ics.hyracks.data.std.primitive.IntegerPointable


    @Override
    protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args)
            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);
                }
View Full Code Here


            return -1;
        }
        TaggedValuePointable tvp = (TaggedValuePointable) TaggedValuePointable.FACTORY.createPointable();
        ExpressionToolbox.getConstantAsPointable((ConstantExpression) argType, tvp);

        IntegerPointable pTypeCode = (IntegerPointable) IntegerPointable.FACTORY.createPointable();
        tvp.getValue(pTypeCode);
        return pTypeCode.getInteger();
    }
View Full Code Here

            return false;
        }
        TaggedValuePointable tvp = (TaggedValuePointable) TaggedValuePointable.FACTORY.createPointable();
        ExpressionToolbox.getConstantAsPointable((ConstantExpression) argType, tvp);

        IntegerPointable pTypeCode = (IntegerPointable) IntegerPointable.FACTORY.createPointable();
        tvp.getValue(pTypeCode);
        SequenceType sType = dCtx.lookupSequenceType(pTypeCode.getInteger());
        if (sType.getQuantifier() != Quantifier.QUANT_ONE) {
            return false;
        }

        // Create replacement assign operator.
View Full Code Here

            return false;
        }
        TaggedValuePointable tvp = (TaggedValuePointable) TaggedValuePointable.FACTORY.createPointable();
        getConstantAsPointable((ConstantExpression) treatArg2, tvp);

        IntegerPointable pTypeCode = (IntegerPointable) IntegerPointable.FACTORY.createPointable();
        tvp.getValue(pTypeCode);
        SequenceType sType = dCtx.lookupSequenceType(pTypeCode.getInteger());

        AbstractLogicalOperator op2 = (AbstractLogicalOperator) assignTreat.getInputs().get(0).getValue();
        if (op2.getOperatorTag() != LogicalOperatorTag.ASSIGN) {
            return false;
        }
View Full Code Here

    private static final long serialVersionUID = 1L;

    @Override
    public IBinaryIntegerInspector createBinaryIntegerInspector(IHyracksTaskContext ctx) {
        final TaggedValuePointable tvp = (TaggedValuePointable) TaggedValuePointable.FACTORY.createPointable();
        final IntegerPointable ip = (IntegerPointable) IntegerPointable.FACTORY.createPointable();
        return new IBinaryIntegerInspector() {
            @Override
            public int getIntegerValue(byte[] bytes, int offset, int length) {
                tvp.set(bytes, offset, length);
                assert tvp.getTag() == ValueTag.XS_INT_TAG;
                tvp.getValue(ip);
                return ip.getInteger();
            }
        };
    }
View Full Code Here

            pp.giveBack(bp);
        }
    }

    private void printInt(PrintStream ps, TaggedValuePointable tvp) {
        IntegerPointable ip = pp.takeOne(IntegerPointable.class);
        try {
            tvp.getValue(ip);
            ps.print(ip.intValue());
        } finally {
            pp.giveBack(ip);
        }
    }
View Full Code Here

            pp.giveBack(tp);
        }
    }

    private void printYMDuration(PrintStream ps, TaggedValuePointable tvp) {
        IntegerPointable ip = pp.takeOne(IntegerPointable.class);
        try {
            tvp.getValue(ip);
            abvs.reset();
            castToString.convertYMDuration(ip, dOut);
            printStringAbvs(ps);
View Full Code Here

            pp.giveBack(bp);
        }
    }

    private void printInt(PrintStream ps, TaggedValuePointable tvp) {
        IntegerPointable ip = pp.takeOne(IntegerPointable.class);
        try {
            tvp.getValue(ip);
            ps.print(ip.intValue());
        } finally {
            pp.giveBack(ip);
        }
    }
View Full Code Here

            pp.giveBack(tp);
        }
    }

    private void printYMDuration(PrintStream ps, TaggedValuePointable tvp) {
        IntegerPointable ip = pp.takeOne(IntegerPointable.class);
        try {
            tvp.getValue(ip);
            abvs.reset();
            castToString.convertYMDuration(ip, dOut);
            printStringAbvs(ps);
View Full Code Here

    @Override
    protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args)
            throws AlgebricksException {
        final SequencePointable seqp = new SequencePointable();
        final LongPointable lp = (LongPointable) LongPointable.FACTORY.createPointable();
        final IntegerPointable ip = (IntegerPointable) IntegerPointable.FACTORY.createPointable();
        final ShortPointable sp = (ShortPointable) ShortPointable.FACTORY.createPointable();
        final BytePointable bp = (BytePointable) BytePointable.FACTORY.createPointable();
        final XSDecimalPointable decp = (XSDecimalPointable) XSDecimalPointable.FACTORY.createPointable();
        final DoublePointable dp = (DoublePointable) DoublePointable.FACTORY.createPointable();
        final FloatPointable fp = (FloatPointable) FloatPointable.FACTORY.createPointable();
        final UTF8StringPointable utf8p = (UTF8StringPointable) UTF8StringPointable.FACTORY.createPointable();
        return new AbstractTaggedValueArgumentScalarEvaluator(args) {
            @Override
            protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException {
                TaggedValuePointable tvp = args[0];
                switch (tvp.getTag()) {
                    case ValueTag.SEQUENCE_TAG: {
                        tvp.getValue(seqp);
                        if (seqp.getEntryCount() == 0) {
                            XDMConstants.setFalse(result);
                            return;
                        }
                        XDMConstants.setTrue(result);
                        return;
                    }

                    case ValueTag.XS_BOOLEAN_TAG: {
                        result.set(tvp);
                        return;
                    }

                    case ValueTag.XS_DECIMAL_TAG: {
                        tvp.getValue(decp);
                        if (decp.longValue() == 0) {
                            XDMConstants.setFalse(result);
                            return;
                        }
                        XDMConstants.setTrue(result);
                        return;
                    }

                    case ValueTag.XS_INTEGER_TAG:
                    case ValueTag.XS_LONG_TAG:
                    case ValueTag.XS_NEGATIVE_INTEGER_TAG:
                    case ValueTag.XS_NON_POSITIVE_INTEGER_TAG:
                    case ValueTag.XS_NON_NEGATIVE_INTEGER_TAG:
                    case ValueTag.XS_POSITIVE_INTEGER_TAG:
                    case ValueTag.XS_UNSIGNED_INT_TAG:
                    case ValueTag.XS_UNSIGNED_LONG_TAG: {
                        tvp.getValue(lp);
                        if (lp.longValue() == 0) {
                            XDMConstants.setFalse(result);
                            return;
                        }
                        XDMConstants.setTrue(result);
                        return;
                    }

                    case ValueTag.XS_INT_TAG:
                    case ValueTag.XS_UNSIGNED_SHORT_TAG: {
                        tvp.getValue(ip);
                        if (ip.intValue() == 0) {
                            XDMConstants.setFalse(result);
                            return;
                        }
                        XDMConstants.setTrue(result);
                        return;
View Full Code Here

TOP

Related Classes of edu.uci.ics.hyracks.data.std.primitive.IntegerPointable

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.