|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jetrix.ClientRepository
public class ClientRepository
Repository of clients connected to the server.
Field Summary | |
---|---|
static Predicate |
OPERATOR_PREDICATE
|
static Predicate |
PLAYER_PREDICATE
|
static Predicate |
SPECTATOR_PREDICATE
|
Method Summary | |
---|---|
void |
addClient(Client client)
Add a client into the repository. |
void |
clear()
|
Client |
getClient(String nickname)
Return the client of the player or spectator with the specified nickname. |
int |
getClientCount()
Return the number of clients connected to this server. |
Collection<Client> |
getClients()
Return an iterator of all clients online in alphabetical order. |
int |
getHostCount(InetAddress address)
Return the number of clients connected from the specified internet address. |
static ClientRepository |
getInstance()
|
Iterator<Client> |
getOperators()
Return an iterator of operators online in alphabetical order. |
int |
getPlayerCount()
Return the number of players connected to this server. |
Iterator<Client> |
getPlayers()
Return an iterator of players online in alphabetical order. |
int |
getSpectatorCount()
Return the number of spectators connected to this server. |
Iterator<Client> |
getSpectators()
Return an iterator of spectators online in alphabetical order. |
void |
removeClient(Client client)
Remove a client from the repository. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Predicate PLAYER_PREDICATE
public static final Predicate SPECTATOR_PREDICATE
public static final Predicate OPERATOR_PREDICATE
Method Detail |
---|
public static ClientRepository getInstance()
public void addClient(Client client)
client
- the client to addpublic void removeClient(Client client)
client
- the client to removepublic Iterator<Client> getPlayers()
public int getPlayerCount()
public Iterator<Client> getSpectators()
public int getSpectatorCount()
public Iterator<Client> getOperators()
public Client getClient(String nickname)
nickname
- nickname of the client to returnpublic Collection<Client> getClients()
public int getClientCount()
public int getHostCount(InetAddress address)
address
- public void clear()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |