public final class Enumerator
extends java.lang.Object
implements java.util.Enumeration
Enumeration
around a
Collection, i.e. Iterator
classes.Constructor and Description |
---|
Enumerator(java.util.Collection collection)
Returns an Enumeration over the specified Collection.
|
Enumerator(java.util.Iterator iterator)
Returns an Enumeration over the values of the
specified Iterator.
|
Enumerator(java.util.Map map)
Returns an Enumeration over the values of the specified Map.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasMoreElements()
Tests if this enumeration contains more elements.
|
java.lang.Object |
nextElement()
Returns the next element of this enumeration.
|
public Enumerator(java.util.Collection collection)
collection
- Collection with values that should be enumeratedpublic Enumerator(java.util.Iterator iterator)
iterator
- Iterator to be wrappedpublic Enumerator(java.util.Map map)
map
- Map with values that should be enumeratedpublic boolean hasMoreElements()
hasMoreElements
in interface java.util.Enumeration
true
if this enumeration contains at
least one more element to provide,
false
otherwise.public java.lang.Object nextElement() throws java.util.NoSuchElementException
nextElement
in interface java.util.Enumeration
java.util.NoSuchElementException
- if no more elements existCopyright © 2019 by Sucang.cn