1 6 7 package org.jfox.jndi; 8 9 import java.util.Iterator ; 10 import java.util.List ; 11 import javax.naming.NamingEnumeration ; 12 import javax.naming.NamingException ; 13 14 17 18 19 public class NamingEnumerationImpl implements NamingEnumeration { 20 Iterator name_class_pair_iterator; 21 22 public NamingEnumerationImpl(List list) { 23 name_class_pair_iterator = list.iterator(); 24 } 25 26 public Object next() throws NamingException { 27 try { 28 return name_class_pair_iterator.next(); 29 } 30 catch(Exception e) { 31 throw new NamingException (e.toString()); 32 } 33 } 34 35 public boolean hasMoreElements() { 36 return name_class_pair_iterator.hasNext(); 39 } 43 44 public boolean hasMore() throws NamingException { 45 try { 46 return name_class_pair_iterator.hasNext(); 47 } 48 catch(Exception e) { 49 throw new NamingException (e.toString()); 50 } 51 } 52 53 public Object nextElement() { 54 return name_class_pair_iterator.next(); 57 } 61 62 public void close() throws NamingException { 63 try { 64 name_class_pair_iterator = null; 65 } 66 catch(Exception e) { 67 throw new NamingException (e.toString()); 68 } 69 } 70 } | Popular Tags |