git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@114 379699f6-c40d-0410-875b-85095c16579estable
parent
e40a33feca
commit
acaa45ed8d
@ -0,0 +1,36 @@ |
||||
/* jode.flow.ArrayEnum (c) 1998 Jochen Hoenicke |
||||
* |
||||
* You may distribute under the terms of the GNU General Public License. |
||||
* |
||||
* IN NO EVENT SHALL JOCHEN HOENICKE BE LIABLE TO ANY PARTY FOR DIRECT, |
||||
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF |
||||
* THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF JOCHEN HOENICKE |
||||
* HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
* JOCHEN HOENICKE SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
||||
* PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" |
||||
* BASIS, AND JOCHEN HOENICKE HAS NO OBLIGATION TO PROVIDE MAINTENANCE, |
||||
* SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
||||
* |
||||
* $Id$ |
||||
*/ |
||||
package jode.flow; |
||||
|
||||
public class ArrayEnum implements java.util.Enumeration { |
||||
int index = 0; |
||||
int size; |
||||
Object[] array; |
||||
|
||||
public ArrayEnum(int size, Object[] array) { |
||||
this.size = size; |
||||
this.array = array; |
||||
} |
||||
|
||||
public boolean hasMoreElements() { |
||||
return index < size; |
||||
} |
||||
public Object nextElement() { |
||||
return array[index++]; |
||||
} |
||||
} |
Loading…
Reference in new issue