01: package jimm.datavision.testdata;
02:
03: import java.util.ArrayList;
04: import java.util.Iterator;
05:
06: /**
07: * Generates test data for the office table. Used by the
08: * <code>CreateData</code> classes found in the database subdirectories.
09: *
10: * @author Jim Menard, <a href="mailto:jimm@io.com">jimm@io.com</a>
11: */
12: public class Office {
13:
14: public static final int NUM_OFFICES = 3;
15:
16: public int id;
17: public String name, abbrev, fax, email;
18: public boolean visible;
19:
20: /**
21: * Returns an iterator over the office test data.
22: *
23: * @return an iterator over <code>Office</code> objects
24: */
25: public static Iterator offices() {
26: ArrayList offices = new ArrayList();
27: offices.add(new Office(1, "New York", "NY", "(212) 555-1234",
28: "nyc_jobs@example.com", true));
29: offices.add(new Office(2, "New Jersey", "NJ", "(973) 555-1234",
30: "nj_jobs@example.com", true));
31: offices.add(new Office(3, "Chicago", "Chicago",
32: "(312) 555-1234", "chicago_jobs@example.com", true));
33: return offices.iterator();
34: }
35:
36: public Office(int i, String n, String a, String f, String e,
37: boolean v) {
38: id = i;
39: name = n;
40: abbrev = a;
41: fax = f;
42: email = e;
43: visible = v;
44: }
45:
46: }
|