diff options
| author | green <green@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-05-08 22:21:50 +0000 |
|---|---|---|
| committer | green <green@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-05-08 22:21:50 +0000 |
| commit | b4fe8cc4464910a7eac139ebd8c48e4d2bf40c00 (patch) | |
| tree | 9c426e950b4514145123e218f2d88bb529e7d72f /libjava/gnu | |
| parent | 0f59ea7de362473929d531e73a3f42c5868fe674 (diff) | |
| download | ppe42-gcc-b4fe8cc4464910a7eac139ebd8c48e4d2bf40c00.tar.gz ppe42-gcc-b4fe8cc4464910a7eac139ebd8c48e4d2bf40c00.zip | |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26842 138bc75d-0d04-0410-961f-82ee72b054a4
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 00000000000..6828439d530 --- /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(); + } +} |

