Class BasicClientSet

  • All Implemented Interfaces:
    ClientSet
    Direct Known Subclasses:
    GuiClientSet

    public class BasicClientSet
    extends java.lang.Object
    implements ClientSet
    Basic ClientSet implementation.
    Since:
    20 Nov 2008
    Author:
    Mark Taylor
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map publicIdMap_  
    • Constructor Summary

      Constructors 
      Constructor Description
      BasicClientSet​(java.util.Comparator clientIdComparator)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(HubClient client)
      Adds a new client to the set.
      boolean containsClient​(HubClient client)
      Indicates whether a given client is currently a member of this set.
      HubClient[] getClients()
      Returns an array of all the currently contained clients.
      HubClient getFromPublicId​(java.lang.String publicId)
      Returns the client in the set corresponding to a given public ID.
      void remove​(HubClient client)
      Removes a client from the set.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • publicIdMap_

        private final java.util.Map publicIdMap_
    • Constructor Detail

      • BasicClientSet

        public BasicClientSet​(java.util.Comparator clientIdComparator)
        Constructor.
        Parameters:
        clientIdComparator - comparator for client IDs
    • Method Detail

      • add

        public void add​(HubClient client)
        Description copied from interface: ClientSet
        Adds a new client to the set.
        Specified by:
        add in interface ClientSet
        Parameters:
        client - client to add
      • remove

        public void remove​(HubClient client)
        Description copied from interface: ClientSet
        Removes a client from the set.
        Specified by:
        remove in interface ClientSet
        Parameters:
        client - client to remove
      • getFromPublicId

        public HubClient getFromPublicId​(java.lang.String publicId)
        Description copied from interface: ClientSet
        Returns the client in the set corresponding to a given public ID.
        Specified by:
        getFromPublicId in interface ClientSet
        Parameters:
        publicId - client public ID
        Returns:
        client with id publicId if registered, or null
      • getClients

        public HubClient[] getClients()
        Description copied from interface: ClientSet
        Returns an array of all the currently contained clients.
        Specified by:
        getClients in interface ClientSet
        Returns:
        client list
      • containsClient

        public boolean containsClient​(HubClient client)
        Description copied from interface: ClientSet
        Indicates whether a given client is currently a member of this set.
        Specified by:
        containsClient in interface ClientSet
        Returns:
        true iff client is currently a member of this set