Code example for Collection

Methods: iterator

0
     * @param collection the collection 
     * @param <T> the member type 
     * @return the enumeration 
     */ 
    public static <T> NamingEnumeration<T> namingEnumeration(final Collection<T> collection) {
        final Iterator<T> iterator = collection.iterator();
        return new NamingEnumeration<T>() { 
            public T next() { 
                return nextElement(); 
            } 
 
            public boolean hasMore() { 
                return hasMoreElements(); 
            } 
 
            public void close() { 
            } 
 
            public boolean hasMoreElements() { 
                return iterator.hasNext();