1 package test.wsdl.arrays3; 2 3 import java.util.Hashtable ; 4 import java.util.Map ; 5 6 7 public class AddressBookImpl 8 { 9 private static Map addresses = new Hashtable (); 10 11 public void addEntry(String name, Address address) 12 { 13 this.addresses.put(name, address); 14 } 15 16 public Address getAddressFromName(String name) 17 { 18 return (Address) this.addresses.get(name); 19 } 20 21 22 public Address[] getAddressFromNames(String [] name) { 23 if (name == null) return null; 24 Address[] result = new Address[name.length]; 25 for(int i=0; i< name.length; i++) { 26 result[i] = getAddressFromName(name[i]); 27 } 28 return result; 29 } 30 31 } 32 | Popular Tags |