Class BasicClientSet

java.lang.Object
org.astrogrid.samp.hub.BasicClientSet
All Implemented Interfaces:
ClientSet

public class BasicClientSet extends Object implements ClientSet
Basic ClientSet implementation.
Since:
20 Nov 2008
Author:
Mark Taylor
  • Constructor Details

    • BasicClientSet

      public BasicClientSet(Comparator clientIdComparator)
      Constructor.
      Parameters:
      clientIdComparator - comparator for client IDs
  • Method Details

    • 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(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