Package org.apache.xindice.core.query

Source Code of org.apache.xindice.core.query.NodeListSet

/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: NodeListSet.java 511426 2007-02-25 03:25:02Z vgritsenko $
*/

package org.apache.xindice.core.query;

import org.apache.xindice.core.data.NodeSet;
import org.apache.xindice.xml.dom.DBNode;
import org.w3c.dom.NodeList;

/**
* NodeListSet is a simple NodeList wrapper
*
* @version $Revision: 511426 $, $Date: 2007-02-24 22:25:02 -0500 (Sat, 24 Feb 2007) $
*/
public final class NodeListSet implements NodeSet {

    public NodeList list;
    public int idx = 0;


    public NodeListSet(NodeList list) {
        this.list = list;
    }

    public boolean hasMoreNodes() {
        return (idx < list.getLength());
    }

    public Object getNextNode() {
        DBNode n = (DBNode) list.item(idx++);
        if (n != null) {
            n.expandSource();
        }
        return n;
    }
}
TOP

Related Classes of org.apache.xindice.core.query.NodeListSet

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.