|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--iaik.utils.ArrayEnumeration
This class implements a simple Enumeration over an array.
When creating an ArrayEnumeration
from an array of objects
you optionally may specify the number of elements of the array that shall
admit to the ArrayEnumeration, e.g.:
will create an ArrayEnumaeration of the first two elements of the given array of objects.SomeObject[] obj = ...; ArrayEnumeration arrayEnum = new ArrayEnumeration(obj, 2);
For getting the elements of an ArrayEnumeration use the
hasMoreElements
and
nextElement
methods, as already
familiarly from the java.util.Enumeration
, e.g.:
for (; arrEnum.hasMoreElements() ; ) { System.out.println(arrayEnum.nextElement()); }
Constructor Summary | |
ArrayEnumeration(Object[] array)
Creates a new ArrayEnumeration from all the elements included in the given array of objects. |
|
ArrayEnumeration(Object[] array,
int length)
Creates a new ArrayEnumeration from the given number of elements of the given array of objects. |
Method Summary | |
boolean |
hasMoreElements()
Checks if there are more elements in this ArrayEnumeration. |
Object |
nextElement()
Returns the next element of this ArrayEnumeration. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ArrayEnumeration(Object[] array)
array
- the arraypublic ArrayEnumeration(Object[] array, int length)
The first length
elements of the given array will
admit to the new ArrayEnumeration.
array
- the arrayMethod Detail |
public boolean hasMoreElements()
hasMoreElements
in interface Enumeration
true
if there are more elements,
false
if notpublic Object nextElement()
nextElement
in interface Enumeration
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |