1 package org.enhydra.barracuda.examples.xmlc.data; 2 3 import java.util.*; 4 5 public class UserData extends HashMap implements Cloneable { 6 7 private boolean newrec = true; 8 private boolean dirty = false; 9 10 public static final String SELECTED = "Selected"; public static final String FIRST_NAME = "FirstName"; public static final String LAST_NAME = "LastName"; public static final String GENDER = "Gender"; public static final String AGE = "Age"; public static final String EMAIL = "Email"; public static final String PHONE = "Phone"; public static final String NOTES = "Notes"; 20 public UserData() { 21 put(UserData.SELECTED, new Boolean (false)); 22 put(UserData.FIRST_NAME, ""); 23 put(UserData.LAST_NAME, ""); 24 put(UserData.GENDER, new Boolean (true)); 25 put(UserData.AGE, new Integer (0)); 26 put(UserData.EMAIL, ""); 27 put(UserData.PHONE, ""); 28 put(UserData.NOTES, ""); 29 setNew(true); 30 setDirty(false); 31 } 32 33 36 public Object put(Object key, Object value) { 37 setDirty(true); 38 return super.put(key, value); 39 } 40 41 44 public void setNew(boolean val) { 45 newrec = val; 46 } 47 48 51 public boolean isNew() { 52 return newrec; 53 } 54 55 58 public void setDirty(boolean val) { 59 dirty = val; 60 } 61 62 65 public boolean isDirty() { 66 return dirty; 67 } 68 69 72 public Object clone() { 73 return super.clone(); 74 } 75 } 76 77 | Popular Tags |