KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > wsdl > arrays3 > AddressBookImpl


1 package test.wsdl.arrays3;
2
3 import java.util.Hashtable JavaDoc;
4 import java.util.Map JavaDoc;
5
6
7 public class AddressBookImpl
8 {
9     private static Map JavaDoc addresses = new Hashtable JavaDoc();
10
11     public void addEntry(String JavaDoc name, Address address)
12     {
13         this.addresses.put(name, address);
14     }
15     
16     public Address getAddressFromName(String JavaDoc name)
17     {
18         return (Address) this.addresses.get(name);
19     }
20     
21
22     public Address[] getAddressFromNames(String JavaDoc[] 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