edu.colorado.cs.ns2.sim
Class ConnectionList

java.lang.Object
  extended by edu.colorado.cs.ns2.sim.ConnectionList
All Implemented Interfaces:
java.io.Serializable

public class ConnectionList
extends java.lang.Object
implements java.io.Serializable

This class maintains a list of active agent connections.

Author:
Kevin Bauer, Pushkar Sambhoos.
See Also:
Serialized Form

Field Summary
private  java.util.Vector<Connection> connections
          List of agent connections.
private static long serialVersionUID
          Generated serial version UID.
 
Constructor Summary
ConnectionList()
          Default constructor.
 
Method Summary
 void addConnection(Connection conn)
          Add a new connection to the list.
 Connection elementAt(int i)
          Return the ith element of the connection list.
 java.util.Vector getConnections()
          Return the connection list.
 Connection getConnectionsElementAt(int i)
          Return the ith element of the connection list.
 void removeConnection(Connection conn)
          Remove an existing connection.
 void removeConnection(int conn)
          Remove an existing connection.
 void setConnections(java.util.Vector<Connection> connections)
          (Re-) Set the connection list.
 int size()
          Return the size of the connection list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Generated serial version UID.

See Also:
Constant Field Values

connections

private java.util.Vector<Connection> connections
List of agent connections.

Constructor Detail

ConnectionList

public ConnectionList()
Default constructor.

Method Detail

addConnection

public void addConnection(Connection conn)
Add a new connection to the list.

Parameters:
conn - A new connection to add.

removeConnection

public void removeConnection(int conn)
Remove an existing connection.

Parameters:
conn - The index of the connection to be removed.

removeConnection

public void removeConnection(Connection conn)
Remove an existing connection.

Parameters:
conn - The connection to be removed.

elementAt

public Connection elementAt(int i)
Return the ith element of the connection list.

Parameters:
i - Index into the connection list.
Returns:
The ith element of the connection list.

getConnections

public java.util.Vector getConnections()
Return the connection list.

Returns:
The connection list.

getConnectionsElementAt

public Connection getConnectionsElementAt(int i)
Return the ith element of the connection list.

Parameters:
i - Index into the connection list.
Returns:
The ith element of the connection list.

setConnections

public void setConnections(java.util.Vector<Connection> connections)
(Re-) Set the connection list.

Parameters:
connections -

size

public int size()
Return the size of the connection list.

Returns:
The size of the connection list.