All Downloads are FREE. Search and download functionalities are using the official Maven repository.

java.util.prefs.NodeSet Maven / Gradle / Ivy

Go to download

A library jar that provides APIs for Applications written for the Google Android Platform.

There is a newer version: 14-robolectric-10818077
Show newest version
package java.util.prefs;

import java.util.ArrayList;
import java.util.Iterator;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

class NodeSet implements NodeList {

    ArrayList list = new ArrayList();

    public NodeSet(Iterator nodes) {
        while(nodes.hasNext()) {
            list.add(nodes.next());
        }
    }

    public int getLength() {
        return list.size();
    }

    public Node item(int index) {
        Node result = null;
        try {
            result = list.get(index);
        } catch(IndexOutOfBoundsException ioobe) {
            // TODO log this event?
            return null;
        }

        return result;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy