tyrex.util

Class ArrayEnumeration

public final class ArrayEnumeration extends Object implements Enumeration

This class provides a way to enumerate over an array. The array is not cloned.

Author: Riad Mohammed

Constructor Summary
ArrayEnumeration(Object[] array)
Create the ArrayEnumeration with the specified array
ArrayEnumeration(Object[] array, int start, int end)
Create the ArrayEnumeration with the specified arguments.
Method Summary
booleanhasMoreElements()
Return true if the enumeration has more elements to return.
ObjectnextElement()
Return the next element in the enumeration.

Constructor Detail

ArrayEnumeration

public ArrayEnumeration(Object[] array)
Create the ArrayEnumeration with the specified array

Parameters: array the array to enumerate over

ArrayEnumeration

public ArrayEnumeration(Object[] array, int start, int end)
Create the ArrayEnumeration with the specified arguments.

Parameters: array the array to enumerate over start the start index inclusive end the end index exclusive

Method Detail

hasMoreElements

public boolean hasMoreElements()
Return true if the enumeration has more elements to return.

Returns: true if the enumeration has more elements to return.

nextElement

public Object nextElement()
Return the next element in the enumeration.

Returns: the next element in the enumeration.

Throws: NoSuchElementException if there are no more elements.

Original code is Copyright (c) 1999-2001, Intalio, Inc. All Rights Reserved. Contributions by MetaBoss team are Copyright (c) 2003-2005, Softaris Pty. Ltd. All Rights Reserved.