Android Open Source - AccountPasswordsAndroid Password Data






From Project

Back to project page AccountPasswordsAndroid.

License

The source code is released under:

GNU General Public License

If you think the Android project AccountPasswordsAndroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.ving.accountpasswords;
/*from  w  w w .j ava  2s .co  m*/
import java.util.regex.PatternSyntaxException;

public class PasswordData implements Comparable<PasswordData> {
  private String account;
  private String userId;
  private String password;
  
  public PasswordData (String newAccount, String newUserId, String newPassword) {
    account = newAccount;
    userId = newUserId;
    password = newPassword;
  }
  
  public PasswordData (String input) {
    try {
      String[] fields = input.split("\\|");
      account = fields[0];
      userId = fields[1];
      password = fields[2];
    } catch (PatternSyntaxException ex) {
      account = "";
      userId = "";
      password = "";
    }
  }
  
  public int compareTo (PasswordData pwd) {
    int rtn = this.account.toLowerCase().compareTo(pwd.account.toLowerCase());
    return rtn;
  }
  
  public String getAccount() {
    return account;
  }
  
  public String getUserId() {
    return userId;
  }
  
  public String getPassword() {
    return password;
  }
  
  public void update(String newAccount, String newUserId, String newPassword) {
    account = newAccount;
    userId = newUserId;
    password = newPassword;
  }

}




Java Source Code List

com.ving.accountpasswords.MainActivity.java
com.ving.accountpasswords.MyApplication.java
com.ving.accountpasswords.PasswordData.java
com.ving.accountpasswords.PasswordListAdapter.java
com.ving.accountpasswords.PostPasswordData.java
com.ving.accountpasswords.ReadKeyFiles.java
com.ving.accountpasswords.ReadPasswordData.java