diff options
| author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2008-02-28 23:50:09 +0000 |
|---|---|---|
| committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2008-02-28 23:50:09 +0000 |
| commit | fa061b7189bfcd21a02ccac393da26ed92f4b21b (patch) | |
| tree | fe6495a24ff49d8088f8e8769b483db47a255cc6 /gnu/java/util | |
| parent | c0daa0df39fcb3be58fba09bb936f515368b085e (diff) | |
| download | classpath-fa061b7189bfcd21a02ccac393da26ed92f4b21b.tar.gz | |
2008-02-28 Andrew John Hughes <gnu_andrew@member.fsf.org>
* gnu/java/util/EmptyEnumeration.java:
Add generic type parameter.
* java/lang/ClassLoader.java:
Use EmptyEnumeration with type parameter.
* java/util/zip/ZipFile.java:
Likewise.
* javax/swing/text/html/StyleSheet.java,
* javax/swing/text/html/ViewAttributeSet.java:
Add generics.
* javax/swing/tree/DefaultMutableTreeNode.java:
Use EmptyEnumeration with type parameter.
Diffstat (limited to 'gnu/java/util')
| -rw-r--r-- | gnu/java/util/EmptyEnumeration.java | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/gnu/java/util/EmptyEnumeration.java b/gnu/java/util/EmptyEnumeration.java index 46a82d6cb..ca2c56d73 100644 --- a/gnu/java/util/EmptyEnumeration.java +++ b/gnu/java/util/EmptyEnumeration.java @@ -51,25 +51,19 @@ import java.util.NoSuchElementException; * * @author Mark Wielaard (mark@klomp.org) */ -public final class EmptyEnumeration implements Enumeration, Serializable +public final class EmptyEnumeration<T> implements Enumeration<T>, Serializable { /** The only instance of this class */ - private static final EmptyEnumeration instance = new EmptyEnumeration(); + private static final EmptyEnumeration<Object> instance = + new EmptyEnumeration<Object>(); /** - * Private constructor that creates a new empty Enumeration. - */ - private EmptyEnumeration() - { - } - - /** - * Returns the only instance of this class. + * Returns an instance of this class for Object. * It can be shared by multiple objects and threads. * * @return the common empty enumeration */ - public static EmptyEnumeration getInstance() + public static EmptyEnumeration<Object> getInstance() { return instance; } @@ -89,7 +83,7 @@ public final class EmptyEnumeration implements Enumeration, Serializable * * @throws NoSuchElementException this is empty */ - public Object nextElement() + public T nextElement() { throw new NoSuchElementException(); } |
