j2me设计论文--手机通讯录内容摘要:

uicontroller = new UIController()。 model = new Model()。 (model)。 } catch (ApplicationException e) { (Error when initial the record Store)。 } } protected void pauseApp() { // TODO Autogenerated method stub } protected void destroyApp(boolean arg0) throws MIDletStateChangeException { // TODO Autogenerated method stub } public UIController getUicontroller() { return uicontroller。 本科课程设计论文 13 } } package。 import .*。 public class Account { private String userName = ,password。 private String mobilePhone =。 private String =。 private String phone =。 public Account(String userName,String mobilePhone,String , String phone) { = userName。 = mobilePhone。 =。 = phone。 } private Account() { } public String getEmail() { return。 } public void setEmail(String ) { =。 } public String getMobilePhone() { return mobilePhone。 } public void setMobilePhone(String mobilePhone) { = mobilePhone。 } public String getPhone() { return phone。 } public void setPhone(String phone) 本科课程设计论文 14 { = phone。 } public String getUserName() { return userName。 } public void setUserName(String userName) { = userName。 } public byte[] serialize() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream()。 DataOutputStream dos = new DataOutputStream(baos)。 (userName)。 (mobilePhone)。 ()。 (phone)。 ()。 ()。 return ()。 } public static Account deserialize(byte[]data)throws IOException { ByteArrayInputStream bais = new ByteArrayInputStream(data)。 DataInputStream dis = new DataInputStream(bais)。 Account account = new Account()。 = ()。 = ()。 = ()。 = ()。 ()。 ()。 return account。 } public static Account deserialize(DataInputStream dis){ Account account=null。 try{ String user=()。 本科课程设计论文 15 String password=()。 // int recid = ()。 account = new Account()。 =user。 = password。 return account。 }catch (Exception e) { // TODO: handle exception } return account。 } public String getPassword() { return password。 } public void setPassword(String password) { = password。 } public static boolean matches(byte[] data,String userName) throws IOException { ByteArrayInputStream bais = new ByteArrayInputStream(data)。 DataInputStream dis = new DataInputStream(bais)。 try { return (()).equals(userName)。 } catch(IOException e) { ()。 return false。 } } } package。 public class ApplicationException extends Exception { private Exception exception。 private int code = 1。 public static final int RECORD_EXIST = 1。 public static final int NO_RECORD = 2。 public ApplicationException(Exception ex) 本科课程设计论文 16 { = ex。 } public ApplicationException(int code) { = code。 } public int getCode() { return code。 } public void setCode(int code) { = code。 } public Exception getException() { return exception。 } public void setException(Exception exception) { = exception。 } } package。 import .*。 public class Index { private String key。 private int recordID。 public Index(String key, int recordID) { = key。 = recordID。 } private Index() { } public String getKey() { return key。 本科课程设计论文 17 } public void setKey(String key) { = key。 } public int getRecordID() { return recordID。 } public void setRecordID(int recordID) { = recordID。 } public byte[] serialize() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream()。 DataOutputStream dos = new DataOutputStream(baos)。 (key)。 (recordID)。 ()。 ()。 return ()。 } public static Index deserialize(byte[] data) throws IOException { ByteArrayInputStream bais = new ByteArrayInputStream(data)。 DataInputStream dis = new DataInputStream(bais)。 Index index = new Index()。 = ()。 = ()。 ()。 ()。 return index。 } public static boolean matches(byte[] data, String key,int type) throws IOException { ByteArrayInputStream bais = new ByteArrayInputStream(data)。 DataInputStream dis = new DataInputStream(bais)。 if(type == 101) { return (()).equals(key)。 本科课程设计论文 18 } else if(type == 102) { return (()).startsWith(key)。 } return false。 } package。 import。 import .*。 import .*。 public class Model { private RecordStore rs = null。 private RecordSt。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。