Package org.jaxen.util

Examples of org.jaxen.util.IdentityHashMap$HashIterator


    }

    public Object evaluate(Context context) throws JaxenException
    {
        List     contextNodeSet  = new ArrayList();
        Map      unique          = new IdentityHashMap();

        contextNodeSet.addAll( context.getNodeSet() );

        Object   eachContextNode = null;

        Iterator stepIter        = getSteps().iterator();
        Step     eachStep        = null;

        List     newNodeSet      = new ArrayList();

        int      contextSize     = 0;

      OUTTER:
        while ( stepIter.hasNext() )
        {
            eachStep = (Step) stepIter.next();

            contextSize = contextNodeSet.size();

          INNER:
            for ( int i = 0 ; i < contextSize ; ++i )
            {
                eachContextNode = contextNodeSet.get( i );
               
                Iterator axisNodeIter = eachStep.axisIterator( eachContextNode,
                                                               context.getContextSupport() );
               
                if ( axisNodeIter == null )
                {
                    continue INNER;
                }
               
                Object   eachAxisNode = null;

                List interimSet=new ArrayList();

                while ( axisNodeIter.hasNext() )
                {
                    eachAxisNode = axisNodeIter.next();

                    // System.err.println( "----> " + eachAxisNode + " // " + eachStep.matches( eachAxisNode, context.getContextSupport()  ) );

                    if ( eachStep.matches( eachAxisNode,
                                           context.getContextSupport() ) )
                    {
                        if ( ! unique.containsKey( eachAxisNode ) )
                        {
                            unique.put( eachAxisNode,
                                        PRESENT );
                            interimSet.add( eachAxisNode );
                        }
                    }
                }

    List filtered = eachStep.getPredicateSet().evaluatePredicates(interimSet,context.getContextSupport() );

    newNodeSet.addAll(filtered);
            }
           
            contextNodeSet.clear();
            contextNodeSet.addAll( newNodeSet );
            newNodeSet.clear();
            unique.clear();
        }
       
        return contextNodeSet;
    }
View Full Code Here


    }

    public List evaluate(Context context) throws JaxenException
    {
        List contextNodeSet  = context.getNodeSet();
        Map unique = new IdentityHashMap();
        int contextSize = contextNodeSet.size();

        List interimSet = new ArrayList();
        List newNodeSet = new ArrayList();

        Object eachContextNode = null;

        INNER:
        for ( int i = 0 ; i < contextSize ; ++i )
        {
            eachContextNode = contextNodeSet.get( i );

            Iterator axisNodeIter = axisIterator( eachContextNode,
                                                  context.getContextSupport() );
            if ( axisNodeIter == null )
            {
                continue INNER;
            }

            Object eachAxisNode = null;
            while ( axisNodeIter.hasNext() )
            {
                eachAxisNode = axisNodeIter.next();

                if ( matches( eachAxisNode,
                              context.getContextSupport() ) )
                {
                    if ( ! unique.containsKey( eachAxisNode ) )
                    {
                        unique.put( eachAxisNode, PRESENT );
                        interimSet.add( eachAxisNode );
                    }
                }
            }
            newNodeSet.addAll(getPredicateSet().evaluatePredicates(
View Full Code Here

TOP

Related Classes of org.jaxen.util.IdentityHashMap$HashIterator

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.