add Collections.enumeration(Collection<T> c)

This commit is contained in:
Zsombor Gegesy 2010-08-15 03:25:51 +02:00 committed by Joel Dice
parent 4dc05844df
commit 03b66375f4

View File

@ -79,6 +79,10 @@ public class Collections {
sb.append("}");
return sb.toString();
}
public static <T> Enumeration<T> enumeration(Collection<T> c) {
return new IteratorEnumeration<T> (c.iterator());
}
static class IteratorEnumeration<T> implements Enumeration<T> {
private final Iterator<T> it;