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
This commit is contained in:
parent
81a1c8c397
commit
e3884aeea7
6 changed files with 148 additions and 13 deletions
52
libjava/gnu/gcj/util/EnumerationChain.java
Normal file
52
libjava/gnu/gcj/util/EnumerationChain.java
Normal file
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue