Package xbird.xquery.type

Examples of xbird.xquery.type.AtomicType


    }

    public Sequence eval(DynamicContext ctxt, Item... args) throws XQueryException {
        assert (args.length == 2) : args;
        // dispatch exec
        final AtomicType retType = getReturnType();
        final Exec exec;
        if(TypeUtil.subtypeOf(retType, IntegerType.INTEGER)) {
            exec = ModInteger.INSTANCE;
        } else if(TypeUtil.subtypeOf(retType, DecimalType.DECIMAL)) {
            exec = ModDecimal.INSTANCE;
View Full Code Here


    }

    public Sequence eval(DynamicContext ctxt, Item... args) throws XQueryException {
        assert (args.length == 2) : args;
        // dispatch exec
        final AtomicType retType = getReturnType();
        final Exec exec;
        if(TypeUtil.subtypeOf(retType, IntegerType.INTEGER)) {
            exec = NumericAddI.INSTANCE;
        } else if(TypeUtil.subtypeOf(retType, DecimalType.DECIMAL)) {
            exec = NumericAddDecimal.INSTANCE;
View Full Code Here

        }
    }

    public void writeExternal(ObjectOutput out) throws IOException {
        ObjectUtils.writeString(out, _lexicalValue);
        final AtomicType type = _type;
        if(type == StringType.STRING) {
            out.writeBoolean(true);
        } else {
            out.writeBoolean(false);
            _type.writeExternal(out);
View Full Code Here

    }

    public Sequence eval(DynamicContext ctxt, Item... args) throws XQueryException {
        assert (args.length == 2) : args;
        // dispatch exec
        final AtomicType retType = getReturnType();
        final Exec exec;
        if(TypeUtil.subtypeOf(retType, IntegerType.INTEGER)) {
            exec = NumericSubI.INSTANCE;
        } else if(TypeUtil.subtypeOf(retType, DecimalType.DECIMAL)) {
            exec = NumericSubDecimal.INSTANCE;
View Full Code Here

    }

    public Sequence eval(DynamicContext ctxt, Item... args) throws XQueryException {
        assert (args.length == 1) : args;
        // dispatch exec
        final AtomicType retType = getReturnType();
        final Exec exec;
        if(TypeUtil.subtypeOf(retType, IntegerType.INTEGER)) {
            exec = NegInteger.INSTANCE;
        } else if(TypeUtil.subtypeOf(retType, DecimalType.DECIMAL)) {
            exec = NegDecimal.INSTANCE;
View Full Code Here

    }

    public Sequence eval(DynamicContext ctxt, Item... args) throws XQueryException {
        assert (args.length == 2) : args;
        // dispatch exec
        final AtomicType retType = getReturnType();
        final Exec exec;
        if(TypeUtil.subtypeOf(retType, IntegerType.INTEGER)) {
            exec = MulInteger.INSTANCE;
        } else if(TypeUtil.subtypeOf(retType, DecimalType.DECIMAL)) {
            exec = MulDecimal.INSTANCE;
View Full Code Here

            throws XQueryException {
        final int ttid = trgType.getTypeId();
        if(ttid == TypeTable.NOTATION_TID || ttid == TypeTable.ANY_ATOM_TID) {
            throw new StaticError("err:XPST0080", "Illegal target type: " + trgType);
        }
        final AtomicType type = _type;
        if(type == trgType) {
            return (T) this;
        }
        final boolean mayCastable = TypeTable.isMayCastable(type, trgType);
        if(mayCastable) {
View Full Code Here

            throws XQueryException {
        final int ttid = trgType.getTypeId();
        if(ttid == TypeTable.NOTATION_TID || ttid == TypeTable.ANY_ATOM_TID) {
            throw new StaticError("err:XPST0080", "Illegal target type: " + trgType);
        }
        final AtomicType type = _type;
        if(type == trgType) {
            return (T) this;
        }
        final boolean mayCastable = TypeTable.isMayCastable(type, trgType);
        if(mayCastable) {
View Full Code Here

                return new XString(item.stringValue());
            }
            final AtomicValue it = (item instanceof AtomicValue) ? (AtomicValue) item
                    : new XString(item.stringValue());
            if(t instanceof AtomicType) {
                final AtomicType trgType = (AtomicType) t;
                final AtomicValue converted = it.castAs(trgType, dynEnv);
                return converted;
            }
            return it;
        }
View Full Code Here

            }
            if(!(expectedArgType instanceof AtomicType)) {
                throw new TypeError("expectedArgType must be built-in atomic type, but was "
                        + expectedArgType);
            }
            final AtomicType expected = (AtomicType) expectedArgType;
            final ValueSequence res = new ValueSequence(dynEnv);
            final IFocus<? extends Item> atomizedItor = argv.atomize(dynEnv).iterator();
            for(Item it : atomizedItor) {
                final Type actualType = it.getType();
                // apply fs:ConvertSimpleOperand
                if(actualType == UntypedAtomicType.UNTYPED_ATOMIC && expected.getTypeId() >= 0) {
                    final AtomicValue casted = ((AtomicValue) it).castAs(expected, dynEnv);
                    res.addItem(casted);
                } else {
                    res.addItem(it);
                }
View Full Code Here

TOP

Related Classes of xbird.xquery.type.AtomicType

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.