Class 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 the SFSZone

    • Constructor Detail

      • SFSBuddyList

        public SFSBuddyList​(java.lang.String ownerName)
      • SFSBuddyList

        public SFSBuddyList​(java.lang.String ownerName,
                            BuddyListManager buddyListManager)
    • Method Detail

      • 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 interface BuddyList
        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 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
      • getBuddy

        public Buddy getBuddy​(java.lang.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 java.util.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
      • getOwnerName

        public java.lang.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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object