1 package org.enhydra.barracuda.examples.xmlc.data; 2 3 import java.util.*; 4 5 10 public class UsersList extends ArrayList { 11 12 private static UsersList masterTable = null; 14 15 private int pos = -1; 17 18 21 public static UsersList getMasterInstance() { 22 if (masterTable==null) masterTable = getSampleInstance(); 23 return masterTable; 24 } 25 26 29 public static void setMasterInstance(UsersList itable) { 30 masterTable = itable; 31 } 32 33 39 public static UsersList getSampleInstance() { 40 UsersList table = new UsersList(); 41 UserData ud = null; 42 43 ud = new UserData(); 44 ud.put(UserData.SELECTED, new Boolean (true)); 45 ud.put(UserData.FIRST_NAME, "John"); 46 ud.put(UserData.LAST_NAME, "Doe"); 47 ud.put(UserData.GENDER, new Boolean (true)); 48 ud.put(UserData.AGE, new Integer (35)); 49 ud.put(UserData.EMAIL, "JohnD@anonymous.com"); 50 ud.put(UserData.PHONE, "831-471-1234"); 51 ud.put(UserData.NOTES, ""); 52 ud.setNew(false); 53 ud.setDirty(false); 54 table.add(ud); 55 56 ud = new UserData(); 57 ud.put(UserData.SELECTED, new Boolean (false)); 58 ud.put(UserData.FIRST_NAME, "Jane"); 59 ud.put(UserData.LAST_NAME, "Lizmon"); 60 ud.put(UserData.GENDER, new Boolean (false)); 61 ud.put(UserData.AGE, new Integer (28)); 62 ud.put(UserData.EMAIL, "123Lizmon@aol.com"); 63 ud.put(UserData.PHONE, "831-471-4321"); 64 ud.put(UserData.NOTES, ""); 65 ud.setNew(false); 66 ud.setDirty(false); 67 table.add(ud); 68 69 ud = new UserData(); 70 ud.put(UserData.SELECTED, new Boolean (true)); 71 ud.put(UserData.FIRST_NAME, "William"); 72 ud.put(UserData.LAST_NAME, "Rensworth"); 73 ud.put(UserData.GENDER, new Boolean (true)); 74 ud.put(UserData.AGE, new Integer (17)); 75 ud.put(UserData.EMAIL, "willier@mcaw.com"); 76 ud.put(UserData.PHONE, "360-413-1556"); 77 ud.put(UserData.NOTES, "Hasn't been seen for weeks..."); 78 ud.setNew(false); 79 ud.setDirty(false); 80 table.add(ud); 81 82 ud = new UserData(); 83 ud.put(UserData.SELECTED, new Boolean (true)); 84 ud.put(UserData.FIRST_NAME, "Brian"); 85 ud.put(UserData.LAST_NAME, "Switer"); 86 ud.put(UserData.GENDER, new Boolean (true)); 87 ud.put(UserData.AGE, new Integer (54)); 88 ud.put(UserData.EMAIL, "brian.switer@aol.com"); 89 ud.put(UserData.PHONE, "831-544-7632"); 90 ud.put(UserData.NOTES, "Brian likes to sail yatchs..."); 91 ud.setNew(false); 92 ud.setDirty(false); 93 table.add(ud); 94 95 ud = new UserData(); 96 ud.put(UserData.SELECTED, new Boolean (false)); 97 ud.put(UserData.FIRST_NAME, "Elizabeth"); 98 ud.put(UserData.LAST_NAME, "McKormick"); 99 ud.put(UserData.GENDER, new Boolean (false)); 100 ud.put(UserData.AGE, new Integer (34)); 101 ud.put(UserData.EMAIL, "lizzym@yahoo.com"); 102 ud.put(UserData.PHONE, "406-731-8856"); 103 ud.put(UserData.NOTES, "Loves ballroom dancing"); 104 ud.setNew(false); 105 ud.setDirty(false); 106 table.add(ud); 107 108 ud = new UserData(); 109 ud.put(UserData.SELECTED, new Boolean (false)); 110 ud.put(UserData.FIRST_NAME, "Sweaty"); 111 ud.put(UserData.LAST_NAME, "Muggeridge"); 112 ud.put(UserData.GENDER, new Boolean (true)); 113 ud.put(UserData.AGE, new Integer (47)); 114 ud.put(UserData.EMAIL, "sm@pigiron.com"); 115 ud.put(UserData.PHONE, "312-435-4487"); 116 ud.put(UserData.NOTES, ""); 117 ud.setNew(false); 118 ud.setDirty(false); 119 table.add(ud); 120 121 ud = new UserData(); 122 ud.put(UserData.SELECTED, new Boolean (false)); 123 ud.put(UserData.FIRST_NAME, "Lawrence"); 124 ud.put(UserData.LAST_NAME, "Welkomich"); 125 ud.put(UserData.GENDER, new Boolean (true)); 126 ud.put(UserData.AGE, new Integer (132)); 127 ud.put(UserData.EMAIL, "lw@letsapolka.com"); 128 ud.put(UserData.PHONE, "944-633-1524"); 129 ud.put(UserData.NOTES, "What is there to say..."); 130 ud.setNew(false); 131 ud.setDirty(false); 132 table.add(ud); 133 134 ud = new UserData(); 135 ud.put(UserData.SELECTED, new Boolean (true)); 136 ud.put(UserData.FIRST_NAME, "Gerhardus"); 137 ud.put(UserData.LAST_NAME, "Voss"); 138 ud.put(UserData.GENDER, new Boolean (true)); 139 ud.put(UserData.AGE, new Integer (132)); 140 ud.put(UserData.EMAIL, "gerhardusv@wts.edu"); 141 ud.put(UserData.PHONE, "755-413-8973"); 142 ud.put(UserData.NOTES, ""); 143 ud.setNew(false); 144 ud.setDirty(false); 145 table.add(ud); 146 147 return table; 148 } 149 150 153 public void setCurrentPos(int ipos) { 154 pos = ipos; 155 } 156 157 160 public int getCurrentPos() { 161 return pos; 162 } 163 164 } 165 166 | Popular Tags |