1 |
/* gnu.java.util.DoubleEnumeration |
/* gnu.java.util.DoubleEnumeration |
2 |
Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. |
Copyright (C) 1998, 1999, 2001, 2004 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
63 |
* @author Jochen Hoenicke |
* @author Jochen Hoenicke |
64 |
* @author Mark Wielaard (mark@klomp.org) |
* @author Mark Wielaard (mark@klomp.org) |
65 |
*/ |
*/ |
66 |
public class DoubleEnumeration implements Enumeration |
public class DoubleEnumeration<T> implements Enumeration<T> |
67 |
{ |
{ |
68 |
/** |
/** |
69 |
* This is true as long as one of the enumerations has more |
* This is true as long as one of the enumerations has more |
82 |
/** |
/** |
83 |
* The first enumeration. |
* The first enumeration. |
84 |
*/ |
*/ |
85 |
private Enumeration e1; |
private Enumeration<T> e1; |
86 |
/** |
/** |
87 |
* The second enumeration. |
* The second enumeration. |
88 |
*/ |
*/ |
89 |
private Enumeration e2; |
private Enumeration<T> e2; |
90 |
|
|
91 |
/** |
/** |
92 |
* Creates a new Enumeration combining the given two enumerations. |
* Creates a new Enumeration combining the given two enumerations. |
93 |
* The enumerations mustn't be accessed by other classes. |
* The enumerations mustn't be accessed by other classes. |
94 |
*/ |
*/ |
95 |
public DoubleEnumeration(Enumeration e1, Enumeration e2) |
public DoubleEnumeration(Enumeration<T> e1, Enumeration<T> e2) |
96 |
{ |
{ |
97 |
this.e1 = e1; |
this.e1 = e1; |
98 |
this.e2 = e2; |
this.e2 = e2; |
126 |
* element of the second enumeration. If both enumeration don't have |
* element of the second enumeration. If both enumeration don't have |
127 |
* any elements it throws a <code>NoSuchElementException</code>. |
* any elements it throws a <code>NoSuchElementException</code>. |
128 |
*/ |
*/ |
129 |
public Object nextElement() |
public T nextElement() |
130 |
{ |
{ |
131 |
if (!hasMoreElements()) |
if (!hasMoreElements()) |
132 |
throw new NoSuchElementException(); |
throw new NoSuchElementException(); |