public class TrackedClientSet
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.Map |
clientMap_ |
private java.util.Map |
clientMapView_ |
Constructor and Description |
---|
TrackedClientSet()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addClient(Client client)
Adds a client to this model.
|
java.util.Map |
getClientMap()
Returns an unmodifiable Map representing the client list.
|
void |
removeClient(Client client)
Removes a client from this model.
|
void |
setClients(Client[] clients)
Sets the contents of this model to a given list.
|
void |
updateClient(Client client,
boolean metaChanged,
boolean subsChanged)
Notifies listeners that a given client's attributes (may) have
changed.
|
private final java.util.Map clientMap_
private final java.util.Map clientMapView_
public void addClient(Client client)
client
- client to addpublic void removeClient(Client client)
client
- client to removepublic void setClients(Client[] clients)
clients
- current client listpublic void updateClient(Client client, boolean metaChanged, boolean subsChanged)
client
- modified clientmetaChanged
- true if metadata may have changed
(false if known unchanged)subsChanged
- true if subscriptions may have changed
(false if known unchanged)public java.util.Map getClientMap()
Client
objects.
This map is synchronized
which means that to iterate over any of its views
you must synchronize on it.
When the map or any of its contents changes, it will receive a
Object.notifyAll()
.