FileDocCategorySizeDatePackage
ListOfFiles.javaAPI DocExample905Tue Dec 12 18:57:42 GMT 2000None

ListOfFiles

public class ListOfFiles extends Object implements Enumeration

Fields Summary
private String[]
listOfFiles
private int
current
Constructors Summary
public ListOfFiles(String[] listOfFiles)


       
        this.listOfFiles = listOfFiles;
    
Methods Summary
public booleanhasMoreElements()

        if (current < listOfFiles.length)
            return true;
        else
            return false;
    
public java.lang.ObjectnextElement()

        InputStream in = null;

        if (!hasMoreElements())
            throw new NoSuchElementException("No more files.");
        else {
            String nextElement = listOfFiles[current];
            current++;
            try {
                in = new FileInputStream(nextElement);
            } catch (FileNotFoundException e) {
                System.err.println("ListOfFiles: Can't open " + nextElement);
            }
        }
        return in;