Class QueueHolder


  • public abstract class QueueHolder
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void addPlayer​(QueuePlayer player)
      Adds a player to the end of the queue NOTE: Do not manually call this! Use the QueueManager to add players to queues
      abstract void addPlayer​(QueuePlayer player, int position)
      Adds a player to the specified position in the queue NOTE: Do not manually call this! Use the QueueManager to add players to queues
      abstract QueuePlayer findPlayer​(java.lang.String name)
      Finds the player with this username in this queue and returns the representative QueuePlayer
      abstract QueuePlayer findPlayer​(java.util.UUID uuid)
      Finds the player with this uuid in this queue and returns the representative QueuePlayer
      QueuePlayer findPlayer​(AdaptedPlayer player)  
      abstract java.util.List<QueuePlayer> getAllPlayers()
      Get all players that are in the queue
      abstract java.lang.String getIdentifier()
      Returns the identifier of this QueueHolder Used by the server owner in order to tell ajQueue to use this QueueHolder
      abstract int getPosition​(QueuePlayer player)  
      abstract int getQueueSize()
      Returns the size of the queue
      void removePlayer​(java.util.UUID uuid)  
      void removePlayer​(AdaptedPlayer player)  
      abstract void removePlayer​(QueuePlayer player)
      Removes a player from the queue
      • Methods inherited from class java.lang.Object

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

      • QueueHolder

        public QueueHolder​(QueueServer queueServer)
    • Method Detail

      • getIdentifier

        public abstract java.lang.String getIdentifier()
        Returns the identifier of this QueueHolder Used by the server owner in order to tell ajQueue to use this QueueHolder
        Returns:
        a string that is very unlikely to be re-used by another QueueHolder
      • addPlayer

        public abstract void addPlayer​(QueuePlayer player)
        Adds a player to the end of the queue NOTE: Do not manually call this! Use the QueueManager to add players to queues
        Parameters:
        player - The QueuePlayer to add
      • addPlayer

        public abstract void addPlayer​(QueuePlayer player,
                                       int position)
        Adds a player to the specified position in the queue NOTE: Do not manually call this! Use the QueueManager to add players to queues
        Parameters:
        player - The QueuePlayer to add
        position - The position to add them to
      • removePlayer

        public void removePlayer​(AdaptedPlayer player)
      • removePlayer

        public void removePlayer​(java.util.UUID uuid)
      • removePlayer

        public abstract void removePlayer​(QueuePlayer player)
        Removes a player from the queue
        Parameters:
        player - The player to remove
      • findPlayer

        public abstract QueuePlayer findPlayer​(java.util.UUID uuid)
        Finds the player with this uuid in this queue and returns the representative QueuePlayer
        Returns:
        The QueuePlayer representing the player, null if not found
      • findPlayer

        public abstract QueuePlayer findPlayer​(java.lang.String name)
        Finds the player with this username in this queue and returns the representative QueuePlayer
        Returns:
        The QueuePlayer representing the player, null if not found
      • getQueueSize

        public abstract int getQueueSize()
        Returns the size of the queue
        Returns:
        The number of players in the queue
      • getPosition

        public abstract int getPosition​(QueuePlayer player)
      • getAllPlayers

        public abstract java.util.List<QueuePlayer> getAllPlayers()
        Get all players that are in the queue
        Returns:
        a list of players in the queue