Examples of AtomicComparer


Examples of net.sf.saxon.sort.AtomicComparer

    /**
    * Evaluate the expression
    */

    public Item evaluateItem(XPathContext context) throws XPathException {
        AtomicComparer collator = getAtomicComparer(2, context);

        SequenceIterator op1 = argument[0].iterate(context);
        SequenceIterator op2 = argument[1].iterate(context);

        Configuration config =
View Full Code Here

Examples of net.sf.saxon.sort.AtomicComparer

        if (arg1==null) {
            return null;
        }
        arg1 = arg1.getPrimitiveValue();

        AtomicComparer collator = getAtomicComparer(2, context);

        int result = collator.compare(arg0, arg1);
        if (result < 0) {
            return IntegerValue.MINUS_ONE;
        } else if (result > 0) {
            return IntegerValue.PLUS_ONE;
        } else {
View Full Code Here

Examples of net.sf.saxon.sort.AtomicComparer

            return vc.simplify(env).analyze(env, contextItemType);
        }

        Comparator comp = env.getCollation(env.getDefaultCollationName());
        if (comp==null) comp = CodepointCollator.getInstance();
        comparer = new AtomicComparer(comp);

        // Check if neither argument allows a sequence of >1

        if (!Cardinality.allowsMany(c0) && !Cardinality.allowsMany(c1)) {
View Full Code Here

Examples of net.sf.saxon.sort.AtomicComparer

    public void setComparator(Comparator comp) {
        if (comp instanceof AtomicComparer) {
            comparer = (AtomicComparer)comp;
        } else {
            comparer = new AtomicComparer(comp);
        }
    }
View Full Code Here

Examples of net.sf.saxon.sort.AtomicComparer

            }
        }

        Comparator comp = env.getCollation(env.getDefaultCollationName());
        if (comp==null) comp = CodepointCollator.getInstance();
        comparer = new AtomicComparer(comp);

        // optimise count(x) eq 0 (or gt 0, ne 0, eq 0, etc)

        if (Aggregate.isCountFunction(operand0) &&
                operand1 instanceof AtomicValue) {
View Full Code Here

Examples of net.sf.saxon.sort.AtomicComparer

        //AtomicComparer comparer = getAtomicComparer(1, context);
        BuiltInAtomicType type = argumentType;
        if (type == BuiltInAtomicType.UNTYPED_ATOMIC) {
            type = BuiltInAtomicType.DOUBLE;
        }
        AtomicComparer comparer =
                GenericAtomicComparer.makeAtomicComparer(type, type, collator, context);
        SequenceIterator iter = argument[0].iterate(context);
        try {
            return minimax(iter, operation, comparer, ignoreNaN, context);
        } catch (XPathException err) {
View Full Code Here

Examples of net.sf.saxon.sort.AtomicComparer

                sortKey.expression = new Atomizer(key, config);
            }

            SortKeyDefinition sk = new SortKeyDefinition();
            sk.setSortKey(sortKey.expression);
            AtomicComparer comp = sk.makeComparator(context);
            AtomicComparer[] comps = {comp};

            iterator = new SortedIterator(context, iterator, this, comps);
            ((SortedIterator)iterator).setHostLanguage(Configuration.XPATH);
        }
View Full Code Here

Examples of net.sf.saxon.sort.AtomicComparer

    /**
    * Evaluate the function to return an iteration of selected values or nodes.
    */

    public SequenceIterator iterate(XPathContext context) throws XPathException {
        AtomicComparer comp = atomicComparer;
        if (comp == null) {
            int type = argument[0].getItemType(context.getConfiguration().getTypeHierarchy()).getPrimitiveType();
            comp = makeAtomicSortComparer(type, context);
        } else {
            comp = comp.provideContext(context);
        }
        SequenceIterator iter = argument[0].iterate(context);
        return new DistinctIterator(iter, comp);
    }
View Full Code Here

Examples of org.pdf4j.saxon.sort.AtomicComparer

        //AtomicComparer comparer = getAtomicComparer(1, context);
        BuiltInAtomicType type = argumentType;
        if (type == BuiltInAtomicType.UNTYPED_ATOMIC) {
            type = BuiltInAtomicType.DOUBLE;
        }
        AtomicComparer comparer =
                GenericAtomicComparer.makeAtomicComparer(type, type, collator, context);
        SequenceIterator iter = argument[0].iterate(context);
        try {
            return minimax(iter, operation, comparer, ignoreNaN, context);
        } catch (XPathException err) {
View Full Code Here

Examples of org.pdf4j.saxon.sort.AtomicComparer

                sortKey.expression = new Atomizer(key, config);
            }

            SortKeyDefinition sk = new SortKeyDefinition();
            sk.setSortKey(sortKey.expression);
            AtomicComparer comp = sk.makeComparator(context);
            AtomicComparer[] comps = {comp};

            iterator = new SortedIterator(context, iterator, this, comps);
            ((SortedIterator)iterator).setHostLanguage(Configuration.XPATH);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.