Class SFSBuddyList

java.lang.Object
com.smartfoxserver.buddylist.SFSBuddyList
All Implemented Interfaces:
BuddyList

public class SFSBuddyList extends Object implements BuddyList
An SFSBuddyList represents one BuddyList in the Buddy System.

BuddyLists are managed by a SFSBuddyListManager which is a component of the SFSZone

  • Constructor Details

    • SFSBuddyList

      public SFSBuddyList(String ownerName)
    • SFSBuddyList

      public SFSBuddyList(String ownerName, BuddyListManager buddyListManager)
  • Method Details

    • 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 interface BuddyList
      Throws:
      SFSBuddyListException
      See Also:
    • removeBuddy

      public Buddy removeBuddy(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 interface BuddyList
      See Also:
    • containsBuddy

      public boolean containsBuddy(String buddyName)
      Description copied from interface: BuddyList
      Checks if a Buddy is contained in the BuddyList
      Specified by:
      containsBuddy in interface BuddyList
      Parameters:
      buddyName - the Buddy name
      Returns:
      true if the list contains a Buddy with the provided name
    • isBuddyBlocked

      public boolean isBuddyBlocked(String buddyName)
      Description copied from interface: BuddyList
      Checks whether the specified Buddy is blocked in this BuddyList
      Specified by:
      isBuddyBlocked in interface BuddyList
      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
      Specified by:
      getSize in interface BuddyList
      Returns:
      the size of the BuddyList without counting 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 interface BuddyList
      Returns:
      the size of the BuddyList
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: BuddyList
      Checks if the BuddyList is empty
      Specified by:
      isEmpty in interface BuddyList
      Returns:
      true if the BuddyList is empty
    • isFull

      public boolean isFull()
      Description copied from interface: BuddyList
      Checks if the BuddyList is full
      Specified by:
      isFull in interface BuddyList
      Returns:
      true if the BuddyList is full
    • clearAll

      public void clearAll()
      Specified by:
      clearAll in interface BuddyList
    • getBuddy

      public Buddy getBuddy(String buddyName)
      Description copied from interface: BuddyList
      Get a Buddy from the BuddyList by name
      Specified by:
      getBuddy in interface BuddyList
      Parameters:
      buddyName - the name of the Buddy
      Returns:
      the Buddy object or null if no Buddy exists with that name
    • getBuddies

      public List<Buddy> getBuddies()
      Description copied from interface: BuddyList
      Get a list of all Buddies in the BuddyList
      Specified by:
      getBuddies in interface BuddyList
      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 interface BuddyList
      Returns:
      a the BuddyManager
    • setBuddyListManager

      public void setBuddyListManager(BuddyListManager buddyListManager)
      Specified by:
      setBuddyListManager in interface BuddyList
    • getOwnerName

      public String getOwnerName()
      Description copied from interface: BuddyList
      Get the name of the owner of this BuddyList
      Specified by:
      getOwnerName in interface BuddyList
      Returns:
      the owner's name
    • getOwner

      public User getOwner()
      Description copied from interface: BuddyList
      Get the User that owns this BuddyList
      Specified by:
      getOwner in interface BuddyList
      Returns:
      the BuddyList owner
    • toSFSArray

      public ISFSArray toSFSArray()
      Specified by:
      toSFSArray in interface BuddyList
    • toString

      public String toString()
      Overrides:
      toString in class Object