迭代器作为枚举
/**from 时 代 J a v a - N o w J a v a . c o m**/ // Licensed to the Apache Software Foundation (ASF) under one //package com.nowjava; import java.util.Enumeration; import java.util.Iterator; public class Main { public static <T> Enumeration<T> iteratorAsEnumeration( final Iterator<T> it) { return new Enumeration<T>() { public boolean hasMoreElements() { return it.hasNext(); }