|
||||||||||
| 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(java.lang.Object[] array)
Creates a new ArrayEnumeration from all the elements included in the given array of objects. |
|
ArrayEnumeration(java.lang.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. |
java.lang.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(java.lang.Object[] array)
array - the array
public ArrayEnumeration(java.lang.Object[] array,
int length)
The first length elements of the given array will
admit to the new ArrayEnumeration.
array - the array| Method Detail |
public boolean hasMoreElements()
true if there are more elements,
false if notpublic java.lang.Object nextElement()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||