Java examples for java.util:Enumeration
Convert Enumeration as Collection
//package com.java2s; import java.util.Collection; import java.util.Enumeration; import java.util.LinkedList; import java.util.List; public class Main { public static <T> Collection<T> asCollection(Enumeration<T> e) { return asList(e); }/*from w w w . ja v a 2s . c o m*/ public static <T> List<T> asList(Enumeration<T> e) { List<T> l = new LinkedList<T>(); while (e.hasMoreElements()) { l.add(e.nextElement()); } return l; } }