mhframework.net
Class MHSerializableClientList

java.lang.Object
  extended by mhframework.net.MHSerializableClientList
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<MHSerializableClientInfo>

public class MHSerializableClientList
extends java.lang.Object
implements java.lang.Iterable<MHSerializableClientInfo>, java.io.Serializable

This class represents the list of connected clients that is passed from the server to the clients during a MHMessageType.BROADCAST_CLIENT_LIST operation.

See Also:
Serialized Form

Constructor Summary
MHSerializableClientList()
           
 
Method Summary
 void add(MHSerializableClientInfo info)
          Add a client information record to this collection.
 MHSerializableClientInfo get(int clientID)
          Retrieve client information by ID number lookup.
 MHSerializableClientInfo get(java.lang.String name)
          Retrieve client information by name lookup.
 java.util.Iterator<MHSerializableClientInfo> iterator()
          Allows the use of enhanced for loops for iterating through this collection.
 void remove(int id)
          Removes a client's information from this collection.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MHSerializableClientList

public MHSerializableClientList()
Method Detail

add

public void add(MHSerializableClientInfo info)
Add a client information record to this collection.

Parameters:
info - The client information record to add.

get

public MHSerializableClientInfo get(int clientID)
Retrieve client information by ID number lookup.

Parameters:
clientID - The ID number of the client to retrieve.
Returns:
The requested client record.

get

public MHSerializableClientInfo get(java.lang.String name)
Retrieve client information by name lookup.

Parameters:
clientID - The name of the client to retrieve.
Returns:
The requested client record.

iterator

public java.util.Iterator<MHSerializableClientInfo> iterator()
Allows the use of enhanced for loops for iterating through this collection.

Specified by:
iterator in interface java.lang.Iterable<MHSerializableClientInfo>

remove

public void remove(int id)
Removes a client's information from this collection.

Parameters:
id - The ID number of the client to remove. This number can be obtained on the server by calling the get() methods in MHClientList. It could be argued that the client should never use this functionality.

size

public int size()