bugfix in url parsing for HTTP.java
[org.ibex.core.git] / src / org / ibex / util / CounterEnumeration.java
1 // Copyright (C) 2004 Adam Megacz <adam@ibex.org> all rights reserved.
2 //
3 // You may modify, copy, and redistribute this code under the terms of
4 // the GNU Library Public License version 2.1, with the exception of
5 // the portion of clause 6a after the semicolon (aka the "obnoxious
6 // relink clause")
7 package org.ibex.util;
8 import java.util.*;
9
10 public class CounterEnumeration implements Enumeration {
11     public final int max;
12     private int cur = 0;
13     public CounterEnumeration(int i) { max = i; }
14     public void reset() { cur = 0; }
15     public boolean hasMoreElements() { return cur < max; }
16     public Object nextElement() { return new Integer(cur++); }
17 }