import java.util.*;

public class VectorApp {
  public static void main(String argv[]) {

    Vector v = new Vector();
    v.addElement(new Customer("John McDee", "2 Rio", "232-2222"));
    v.addElement(new Customer("Sarah Lee", "75 Spadina", "343-3333"));

    for(int i =0; i<v.size(); i++) {
      Customer c = (Customer) v.elementAt(i);
      // search the vector by name
      if(c.getName().equals("John McDee")) {
        System.out.println("John's address is: "+c.getAddress());
        System.out.println("John's phone number is: "+c.getPhone());
      }
      // search the vector by phone number
      if(c.getPhone().equals("343-3333")) {
        System.out.println("Your name is: "+c.getName());
        System.out.println("Your address is: "+c.getAddress());
      }
    }
  }
}