licensing update to APSL 2.0
[org.ibex.util.git] / src / org / ibex / util / CounterEnumeration.java
1 // Copyright 2000-2005 the Contributors, as shown in the revision logs.
2 // Licensed under the Apache Public Source License 2.0 ("the License").
3 // You may not use this file except in compliance with the License.
4
5 package org.ibex.util;
6 import java.util.*;
7
8 public class CounterEnumeration implements Enumeration {
9     public final int max;
10     private int cur = 0;
11     public CounterEnumeration(int i) { max = i; }
12     public void reset() { cur = 0; }
13     public boolean hasMoreElements() { return cur < max; }
14     public Object nextElement() { return new Integer(cur++); }
15 }