Customerspublic class Customers extends Object
Fields Summary |
---|
private static Vector | customers | private static int | nextSeqNo |
Methods Summary |
---|
public static void | create(java.lang.String lastName, java.lang.String firstName, java.lang.String birthDate, java.lang.String line1, java.lang.String line2, java.lang.String city, java.lang.String state, java.lang.String zip, java.lang.String country)
//*********************************************************************
// Datastore operations
create(lastName, firstName, birthDate, line1, line2, city, state, zip,
country, null, null);
| public static void | create(java.lang.String lastName, java.lang.String firstName, java.lang.String birthDate, java.lang.String line1, java.lang.String line2, java.lang.String city, java.lang.String state, java.lang.String zip, java.lang.String country, java.lang.String phoneHome, java.lang.String phoneCell)Create new customer
Customer customer =
new Customer(++nextSeqNo, lastName, firstName,
genDate(birthDate), genAddress(line1, line2, city, state, zip, country),
phoneHome, phoneCell);
customers.add(customer);
| public static java.util.Collection | findAll()Find all customers
return customers;
| private static Address | genAddress(java.lang.String line1, java.lang.String line2, java.lang.String city, java.lang.String state, java.lang.String zip, java.lang.String country)
return new Address(line1, line2, city, state, zip, country);
| private static java.util.Date | genDate(java.lang.String dateString)
DateFormat df = new SimpleDateFormat("M/d/y");
Date date;
try {
date = df.parse(dateString);
} catch (Exception ex) {
date = null;
}
return date;
|
|