com.tootsville
Class UserList

java.lang.Object
  extended by org.starhope.appius.util.ManagedReferenceHolder
      extended by org.starhope.appius.sql.SQLPeerDatum
          extended by com.tootsville.UserList
All Implemented Interfaces:
java.io.Serializable

public class UserList
extends SQLPeerDatum

Generic class that handles both buddy lists and ignore lists, depending upon its mood. Unlike most of my stuff, you can actually use the constructor safely, here.

Author:
brpocock
See Also:
Serialized Form

Constructor Summary
UserList(User myGuy, boolean buddyTrueBlockFalse)
           
 
Method Summary
 boolean addUser(User other)
          TODO: document this method (brpocock, Sep 25, 2009)
 User[] asArrayOfUsers()
          Deprecated. 
 java.util.Set<java.lang.String> asNames()
          TODO: document this method (brpocock, Oct 13, 2009)
 void changed()
          (non-Javadoc)
 void flush()
          This is an overriding method.
 boolean isOnList(it.gotoandplay.smartfoxserver.data.User u)
          WRITEME: document this method (brpocock, Aug 31, 2009)
 boolean removeUser(User other)
          TODO: document this method (brpocock, Sep 25, 2009)
 int size()
           
 org.json.JSONObject toJSON(AbstractZone zone)
           
 
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum
get, prepare, set, toJSON
 
Methods inherited from class org.starhope.appius.util.ManagedReferenceHolder
deref, setRef
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserList

public UserList(User myGuy,
                boolean buddyTrueBlockFalse)
Parameters:
myGuy - The user whose buddy list or ignore list is being instantiated
buddyTrueBlockFalse - true, for buddy list; false, for ignore list.
Method Detail

addUser

public boolean addUser(User other)
TODO: document this method (brpocock, Sep 25, 2009)

Parameters:
other - The other user, to be added to this list
Returns:
true, if the user has been added. False, if the user was already there.

asArrayOfUsers

@Deprecated
public User[] asArrayOfUsers()
Deprecated. 

Returns:
WRITEME

asNames

public java.util.Set<java.lang.String> asNames()
TODO: document this method (brpocock, Oct 13, 2009)

Returns:
WRITEME

changed

public void changed()
(non-Javadoc)

Overrides:
changed in class SQLPeerDatum
See Also:
SQLPeerDatum.changed()

flush

public void flush()
This is an overriding method.

Specified by:
flush in class SQLPeerDatum
See Also:
SQLPeerDatum.flush()

isOnList

public boolean isOnList(it.gotoandplay.smartfoxserver.data.User u)
WRITEME: document this method (brpocock, Aug 31, 2009)

Parameters:
u - the user who might be on the list
Returns:
true, if the user is on the list

removeUser

public boolean removeUser(User other)
TODO: document this method (brpocock, Sep 25, 2009)

Parameters:
other - the user to be removed from the list
Returns:
true, if the user were removed

size

public int size()
Returns:
the number of Users in this UserList

toJSON

public org.json.JSONObject toJSON(AbstractZone zone)
                           throws org.json.JSONException
Parameters:
zone - WRITEME
Returns:
WRITEME
Throws:
org.json.JSONException - WRITEME