import java.util.Vector; // Java container class import java.util.Hashtable; // Java lookup mechanism based on key public class Investor { public String INVESTOR_ID; // primary key public String PASSWORD; // public visibility: same as a record struct public String FIRST; public String LAST; public String PHONE; public Vector accounts = new Vector(); // list of all account children: 1 to many // children add themselves to this container public static Hashtable investors = new Hashtable(); // find investor keyed on INVESTOR_ID // static: just one hashtable public Investor(String INVESTOR_ID, String PASSWORD, String FIRST, String LAST, String PHONE){ this.INVESTOR_ID = INVESTOR_ID; this.PASSWORD = PASSWORD; this.FIRST = FIRST; this.LAST = LAST; this.PHONE = PHONE; investors.put(INVESTOR_ID, this); // put itself into the hashtable using primary key } public String toString() { return (INVESTOR_ID + " " + LAST + " " + FIRST + " " + PHONE); } }