Package xbird.xquery.type

Examples of xbird.xquery.type.ChoiceType


    public static boolean isPromotable(final Type src, final AtomicType trg) {
        final Type primeType = src.prime();
        if(primeType instanceof AtomicType) {
            return TypeTable.isCastable((AtomicType) primeType, trg, true);
        } else if(primeType instanceof ChoiceType) {
            final ChoiceType choise = (ChoiceType) primeType;
            for(Type c : choise.getTypes()) {
                if(!isPromotable(c, trg)) {
                    return false;
                }
            }
            return true;
View Full Code Here


    public static Type union(final Type baseType, final Type type) {
        if(baseType instanceof ChoiceType) {
            ((ChoiceType) baseType).combine(type);
            return baseType;
        } else {
            return new ChoiceType(baseType, type);
        }
    }
View Full Code Here

    public Occurrence quantifier() {
        return Occurrence.OCC_EXACTLY_ONE;  // FIXME
    }

    public Type prime() {
        return new ChoiceType(_list);
    }
View Full Code Here

            if(condExpr instanceof Evaluable) {
                Sequence<? extends Item> evaluated = condExpr.eval(null, DynamicContext.DUMMY);
                boolean cond = FnBoolean.effectiveBooleanValue(evaluated);
                return cond ? thenExpr : elseExpr;
            }
            this._type = new ChoiceType(thenExpr.getType(), elseExpr.getType());
        }
        return this;
    }
View Full Code Here

TOP

Related Classes of xbird.xquery.type.ChoiceType

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.