1 22 package org.objectweb.petals.kernel.registry.jndi; 23 24 import java.util.Arrays ; 25 import java.util.Iterator ; 26 27 import javax.naming.NamingEnumeration ; 28 import javax.naming.NamingException ; 29 30 35 public class NamingEnumerationImpl<T> implements NamingEnumeration <T> { 36 37 40 protected Iterator <T> iterator; 41 42 public NamingEnumerationImpl(T[] array) { 43 super(); 44 iterator = Arrays.asList(array).iterator(); 45 } 46 47 50 public void close() throws NamingException { 51 iterator = null; 52 } 53 54 57 public boolean hasMore() throws NamingException { 58 return iterator.hasNext(); 59 } 60 61 public boolean hasMoreElements() { 62 return iterator.hasNext(); 63 } 64 65 68 public T next() throws NamingException { 69 return iterator.next(); 70 } 71 72 public T nextElement() { 73 return iterator.next(); 74 } 75 76 } 77 | Popular Tags |