FileDocCategorySizeDatePackage
ResourceBundleEnumeration.javaAPI DocJava SE 5 API1757Fri Aug 26 14:57:24 BST 2005java.util

ResourceBundleEnumeration

public class ResourceBundleEnumeration extends Object implements Enumeration
Implements an Enumeration that combines elements from a Set and an Enumeration. Used by ListResourceBundle and PropertyResourceBundle.

Fields Summary
Set
set
Iterator
iterator
Enumeration
enumeration
String
next
Constructors Summary
ResourceBundleEnumeration(Set set, Enumeration enumeration)
Constructs a resource bundle enumeration.

param
set an set providing some elements of the enumeration
param
enumeration an enumeration providing more elements of the enumeration. enumeration may be null.

        this.set = set;
        this.iterator = set.iterator();
        this.enumeration = enumeration;
    
Methods Summary
public booleanhasMoreElements()

            
       
        if (next == null) {
            if (iterator.hasNext()) {
                next = iterator.next();
            } else if (enumeration != null) {
                while (next == null && enumeration.hasMoreElements()) {
                    next = enumeration.nextElement();
                    if (set.contains(next)) {
                        next = null;
                    }
                }
            }
        }
        return next != null;
    
public java.lang.StringnextElement()

        if (hasMoreElements()) {
            String result = next;
            next = null;
            return result;
        } else {
            throw new NoSuchElementException();
        }