Class QueueHolder
- java.lang.Object
-
- us.ajg0702.queue.api.queueholders.QueueHolder
-
public abstract class QueueHolder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description QueueHolder(QueueServer queueServer)
-
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 queuesabstract 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 queuesabstract QueuePlayer
findPlayer(java.lang.String name)
Finds the player with this username in this queue and returns the representative QueuePlayerabstract QueuePlayer
findPlayer(java.util.UUID uuid)
Finds the player with this uuid in this queue and returns the representative QueuePlayerQueuePlayer
findPlayer(AdaptedPlayer player)
abstract java.util.List<QueuePlayer>
getAllPlayers()
Get all players that are in the queueabstract java.lang.String
getIdentifier()
Returns the identifier of this QueueHolder Used by the server owner in order to tell ajQueue to use this QueueHolderabstract int
getPosition(QueuePlayer player)
abstract int
getQueueSize()
Returns the size of the queuevoid
removePlayer(java.util.UUID uuid)
void
removePlayer(AdaptedPlayer player)
abstract void
removePlayer(QueuePlayer player)
Removes a player from the queue
-
-
-
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 addposition
- 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
-
findPlayer
public QueuePlayer findPlayer(AdaptedPlayer player)
-
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
-
-