1 package com.atlassian.user.util;
2
3 import java.util.Enumeration;
4 import java.util.Iterator;
5
6
7
8
9 public class EnumerationAdaptor<T> implements Iterator<T>
10 {
11 private final Enumeration<T> enumeration;
12
13 public EnumerationAdaptor(Enumeration<T> enumeration)
14 {
15 Assert.notNull(enumeration, "enumeration");
16 this.enumeration = enumeration;
17 }
18
19 public void remove()
20 {
21 throw new UnsupportedOperationException();
22 }
23
24 public boolean hasNext()
25 {
26 return enumeration.hasMoreElements();
27 }
28
29 public T next()
30 {
31 return enumeration.nextElement();
32 }
33 }