diff options
author | Anthony Green <green@cygnus.com> | 1999-05-08 22:21:50 +0000 |
---|---|---|
committer | Anthony Green <green@gcc.gnu.org> | 1999-05-08 22:21:50 +0000 |
commit | e3884aeea7b5b9a6065446a55b28d18cabc680da (patch) | |
tree | 9c426e950b4514145123e218f2d88bb529e7d72f /libjava/gnu | |
parent | 81a1c8c397b596fe7cb87338b32d189aa1bce270 (diff) | |
download | gcc-e3884aeea7b5b9a6065446a55b28d18cabc680da.zip gcc-e3884aeea7b5b9a6065446a55b28d18cabc680da.tar.gz gcc-e3884aeea7b5b9a6065446a55b28d18cabc680da.tar.bz2 |
DateFormat.java (computeInstance): Separate time and date styles.
* java/text/DateFormat.java (computeInstance): Separate time
and date styles.
(getDateTimeInstance): Ditto.
(getDateTimeInstance(int,int)): New method.
* Makefile.in: Rebuilt.
* Makefile.am (ordinary_java_source_files): Add new classes.
* java/util/PropertyResourceBundle.java: New file.
* gnu/gcj/util/EnumerationChain.java: New file.
From-SVN: r26842
Diffstat (limited to 'libjava/gnu')
-rw-r--r-- | libjava/gnu/gcj/util/EnumerationChain.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/libjava/gnu/gcj/util/EnumerationChain.java b/libjava/gnu/gcj/util/EnumerationChain.java new file mode 100644 index 0000000..6828439 --- /dev/null +++ b/libjava/gnu/gcj/util/EnumerationChain.java @@ -0,0 +1,52 @@ +/* Copyright (C) 1999 Cygnus Solutions + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + +package gnu.gcj.util; + +import java.util.Enumeration; +import java.util.NoSuchElementException; + +public class EnumerationChain implements Enumeration +{ + private Enumeration first_; + private Enumeration second_; + + public EnumerationChain (Enumeration first, Enumeration second) + { + if (first == null + || second == null) + throw new NullPointerException(); + + first_ = first; + second_ = second; + } + + public synchronized boolean hasMoreElements() + { + if (first_ == null) + return false; + else + return first_.hasMoreElements(); + } + + public synchronized Object nextElement() throws NoSuchElementException + { + while (first_ != null) + { + if (! first_.hasMoreElements()) + { + first_ = second_; + second_ = null; + } + else + return first_.nextElement(); + } + + throw new NoSuchElementException(); + } +} |