Methods Summary |
---|
public synchronized void | addUser(User nu)
// Add it to the in-memory list
users.add(nu);
// Add it to the on-disk version
// N.B. - must be done in subclass.
|
public abstract void | deleteUser(java.lang.String nick)
|
public static jabadot.UserDB | getInstance()"factory" method to get an instance, which will always be
the Singleton.
if (singleton == null)
throw new IllegalStateException(
"UserDB initialization failed (singleton was null)");
return singleton;
|
public User | getUser(java.lang.String nick)Get the User object for a given nickname
Iterator it = users.iterator();
while (it.hasNext()) {
User u = (User)it.next();
if (u.getName().equals(nick))
return u;
}
return null;
|
public java.util.ArrayList | getUserList()Get the list of users.
return users;
|
public abstract void | setPassword(java.lang.String nick, java.lang.String newPass)
|