Package com.smartfoxserver.v2.buddylist
Class SFSBuddyList
- java.lang.Object
-
- com.smartfoxserver.v2.buddylist.SFSBuddyList
-
- All Implemented Interfaces:
BuddyList
public class SFSBuddyList extends java.lang.Object implements BuddyList
An SFSBuddyList represents one BuddyList in the Buddy System.BuddyLists are managed by a
SFSBuddyListManager
which is a component of theSFSZone
-
-
Constructor Summary
Constructors Constructor Description SFSBuddyList(java.lang.String ownerName)
SFSBuddyList(java.lang.String ownerName, BuddyListManager buddyListManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Buddy
addBuddy(Buddy buddy)
Used by the BuddyManager only.void
clearAll()
boolean
containsBuddy(java.lang.String buddyName)
Checks if a Buddy is contained in the BuddyListjava.util.List<Buddy>
getBuddies()
Get a list of all Buddies in the BuddyListBuddy
getBuddy(java.lang.String buddyName)
Get a Buddy from the BuddyList by nameBuddyListManager
getBuddyListManager()
Get a reference to the BuddyManager managing this BuddyListUser
getOwner()
Get the User that owns this BuddyListjava.lang.String
getOwnerName()
Get the name of the owner of this BuddyListint
getRuntimeSize()
Obtain the size of the BuddyList, including the temp buddiesint
getSize()
Obtain the size of the BuddyList.boolean
isBuddyBlocked(java.lang.String buddyName)
Checks whether the specified Buddy is blocked in this BuddyListboolean
isEmpty()
Checks if the BuddyList is emptyboolean
isFull()
Checks if the BuddyList is fullBuddy
removeBuddy(java.lang.String buddyName)
Used by the BuddyManager only.void
setBuddyListManager(BuddyListManager buddyListManager)
ISFSArray
toSFSArray()
java.lang.String
toString()
-
-
-
Constructor Detail
-
SFSBuddyList
public SFSBuddyList(java.lang.String ownerName)
-
SFSBuddyList
public SFSBuddyList(java.lang.String ownerName, BuddyListManager buddyListManager)
-
-
Method Detail
-
addBuddy
public Buddy addBuddy(Buddy buddy) throws SFSBuddyListException
Description copied from interface:BuddyList
Used by the BuddyManager only.
If you want to add a Buddy to User's list please use the BuddyAPI- Specified by:
addBuddy
in interfaceBuddyList
- Throws:
SFSBuddyListException
- See Also:
SFSBuddyApi.addBuddy(User, String, boolean, boolean, boolean)
-
removeBuddy
public Buddy removeBuddy(java.lang.String buddyName)
Description copied from interface:BuddyList
Used by the BuddyManager only.
If you want to remove a Buddy from the User's list please use the BuddyAPI.- Specified by:
removeBuddy
in interfaceBuddyList
- See Also:
SFSBuddyApi.removeBuddy(User, String, boolean, boolean)
-
containsBuddy
public boolean containsBuddy(java.lang.String buddyName)
Description copied from interface:BuddyList
Checks if a Buddy is contained in the BuddyList- Specified by:
containsBuddy
in interfaceBuddyList
- Parameters:
buddyName
- the Buddy name- Returns:
- true if the list contains a Buddy with the provided name
-
isBuddyBlocked
public boolean isBuddyBlocked(java.lang.String buddyName)
Description copied from interface:BuddyList
Checks whether the specified Buddy is blocked in this BuddyList- Specified by:
isBuddyBlocked
in interfaceBuddyList
- Parameters:
buddyName
- the name of the Buddy- Returns:
- true if the Buddy is blocked
-
getSize
public int getSize()
Description copied from interface:BuddyList
Obtain the size of the BuddyList. The returned value does not count the temporary Buddies
-
getRuntimeSize
public int getRuntimeSize()
Description copied from interface:BuddyList
Obtain the size of the BuddyList, including the temp buddies- Specified by:
getRuntimeSize
in interfaceBuddyList
- Returns:
- the size of the BuddyList
-
isEmpty
public boolean isEmpty()
Description copied from interface:BuddyList
Checks if the BuddyList is empty
-
isFull
public boolean isFull()
Description copied from interface:BuddyList
Checks if the BuddyList is full
-
getBuddy
public Buddy getBuddy(java.lang.String buddyName)
Description copied from interface:BuddyList
Get a Buddy from the BuddyList by name
-
getBuddies
public java.util.List<Buddy> getBuddies()
Description copied from interface:BuddyList
Get a list of all Buddies in the BuddyList- Specified by:
getBuddies
in interfaceBuddyList
- Returns:
- all the Buddy objects in the BuddyList
-
getBuddyListManager
public BuddyListManager getBuddyListManager()
Description copied from interface:BuddyList
Get a reference to the BuddyManager managing this BuddyList- Specified by:
getBuddyListManager
in interfaceBuddyList
- Returns:
- a the BuddyManager
-
setBuddyListManager
public void setBuddyListManager(BuddyListManager buddyListManager)
- Specified by:
setBuddyListManager
in interfaceBuddyList
-
getOwnerName
public java.lang.String getOwnerName()
Description copied from interface:BuddyList
Get the name of the owner of this BuddyList- Specified by:
getOwnerName
in interfaceBuddyList
- Returns:
- the owner's name
-
getOwner
public User getOwner()
Description copied from interface:BuddyList
Get the User that owns this BuddyList
-
toSFSArray
public ISFSArray toSFSArray()
- Specified by:
toSFSArray
in interfaceBuddyList
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-