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
SFSBuddyListManagerwhich 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 BuddyaddBuddy(Buddy buddy)Used by the BuddyManager only.voidclearAll()booleancontainsBuddy(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 BuddyListBuddygetBuddy(java.lang.String buddyName)Get a Buddy from the BuddyList by nameBuddyListManagergetBuddyListManager()Get a reference to the BuddyManager managing this BuddyListUsergetOwner()Get the User that owns this BuddyListjava.lang.StringgetOwnerName()Get the name of the owner of this BuddyListintgetRuntimeSize()Obtain the size of the BuddyList, including the temp buddiesintgetSize()Obtain the size of the BuddyList.booleanisBuddyBlocked(java.lang.String buddyName)Checks whether the specified Buddy is blocked in this BuddyListbooleanisEmpty()Checks if the BuddyList is emptybooleanisFull()Checks if the BuddyList is fullBuddyremoveBuddy(java.lang.String buddyName)Used by the BuddyManager only.voidsetBuddyListManager(BuddyListManager buddyListManager)ISFSArraytoSFSArray()java.lang.StringtoString()
-
-
-
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:BuddyListUsed by the BuddyManager only.
If you want to add a Buddy to User's list please use the BuddyAPI- Specified by:
addBuddyin interfaceBuddyList- Throws:
SFSBuddyListException- See Also:
SFSBuddyApi.addBuddy(User, String, boolean, boolean, boolean)
-
removeBuddy
public Buddy removeBuddy(java.lang.String buddyName)
Description copied from interface:BuddyListUsed by the BuddyManager only.
If you want to remove a Buddy from the User's list please use the BuddyAPI.- Specified by:
removeBuddyin interfaceBuddyList- See Also:
SFSBuddyApi.removeBuddy(User, String, boolean, boolean)
-
containsBuddy
public boolean containsBuddy(java.lang.String buddyName)
Description copied from interface:BuddyListChecks if a Buddy is contained in the BuddyList- Specified by:
containsBuddyin 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:BuddyListChecks whether the specified Buddy is blocked in this BuddyList- Specified by:
isBuddyBlockedin interfaceBuddyList- Parameters:
buddyName- the name of the Buddy- Returns:
- true if the Buddy is blocked
-
getSize
public int getSize()
Description copied from interface:BuddyListObtain the size of the BuddyList. The returned value does not count the temporary Buddies
-
getRuntimeSize
public int getRuntimeSize()
Description copied from interface:BuddyListObtain the size of the BuddyList, including the temp buddies- Specified by:
getRuntimeSizein interfaceBuddyList- Returns:
- the size of the BuddyList
-
isEmpty
public boolean isEmpty()
Description copied from interface:BuddyListChecks if the BuddyList is empty
-
isFull
public boolean isFull()
Description copied from interface:BuddyListChecks if the BuddyList is full
-
getBuddy
public Buddy getBuddy(java.lang.String buddyName)
Description copied from interface:BuddyListGet a Buddy from the BuddyList by name
-
getBuddies
public java.util.List<Buddy> getBuddies()
Description copied from interface:BuddyListGet a list of all Buddies in the BuddyList- Specified by:
getBuddiesin interfaceBuddyList- Returns:
- all the Buddy objects in the BuddyList
-
getBuddyListManager
public BuddyListManager getBuddyListManager()
Description copied from interface:BuddyListGet a reference to the BuddyManager managing this BuddyList- Specified by:
getBuddyListManagerin interfaceBuddyList- Returns:
- a the BuddyManager
-
setBuddyListManager
public void setBuddyListManager(BuddyListManager buddyListManager)
- Specified by:
setBuddyListManagerin interfaceBuddyList
-
getOwnerName
public java.lang.String getOwnerName()
Description copied from interface:BuddyListGet the name of the owner of this BuddyList- Specified by:
getOwnerNamein interfaceBuddyList- Returns:
- the owner's name
-
getOwner
public User getOwner()
Description copied from interface:BuddyListGet the User that owns this BuddyList
-
toSFSArray
public ISFSArray toSFSArray()
- Specified by:
toSFSArrayin interfaceBuddyList
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-