⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resourcebundleenumeration.java

📁 java源代码 请看看啊 提点宝贵的意见
💻 JAVA
字号:
/* * @(#)ResourceBundleEnumeration.java	1.3 03/01/23 * * Copyright 2003 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package java.util;/** * Implements an Enumeration that combines elements from a Set and * an Enumeration. Used by ListResourceBundle and PropertyResourceBundle. */class ResourceBundleEnumeration implements Enumeration {    Set set;    Iterator iterator;    Enumeration enumeration; // may remain null    /**     * 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.     */    ResourceBundleEnumeration(Set set, Enumeration enumeration) {        this.set = set;        this.iterator = set.iterator();        this.enumeration = enumeration;    }    Object next = null;                public boolean hasMoreElements() {        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 Object nextElement() {        if (hasMoreElements()) {            Object result = next;            next = null;            return result;        } else {            throw new NoSuchElementException();        }    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -