aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu
diff options
context:
space:
mode:
authorAnthony Green <green@cygnus.com>1999-05-08 22:21:50 +0000
committerAnthony Green <green@cygnus.com>1999-05-08 22:21:50 +0000
commit7ed80cb82d858978a14f6634dcf931a1f7260e52 (patch)
tree9c426e950b4514145123e218f2d88bb529e7d72f /libjava/gnu
parent4ab4cdc4493d597a1b2eb4039c20cba0b3de8146 (diff)
* 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: https://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.java52
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();
+ }
+}