edu.colorado.cs.ns2.agents
Class NullAgent

java.lang.Object
  extended by edu.colorado.cs.ns2.agents.Agent
      extended by edu.colorado.cs.ns2.agents.NullAgent
All Implemented Interfaces:
java.io.Serializable

public class NullAgent
extends Agent

This class implements the NS2 Null Agent. This Agent is a UDP sink.

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

Field Summary
private static long serialVersionUID
          Generated serial version UID.
 
Fields inherited from class edu.colorado.cs.ns2.agents.Agent
acceptableConnectAgents, agentId, agentName, applications, isConnected, nodeId, variableName
 
Constructor Summary
NullAgent(int nextId, int nodeId)
          Constructor.
 
Method Summary
 boolean isConnected()
          Returns True if the current Agent is connect to another Agent.
private  void setAcceptableAgents()
          Sets the Vector of acceptable agents to which this Agent may connect.
 void setAgentProperties()
          Sets this Agent's properties.
 java.lang.String toString()
          Returns a String representation of this class.
 java.lang.String writeAgentProperties()
          Returns a TCP representation of the Agent's properties.
 
Methods inherited from class edu.colorado.cs.ns2.agents.Agent
addAgentToScript, canConnectToAgent, canHaveMultipleConnections, getAgentId, getAgentName, getApplications, getApplicationsElementAt, getNodeId, getVariableName, removeApplicationsElement, removeApplicationsElementAt, setAgentId, setApplications, setConnected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Generated serial version UID.

See Also:
Constant Field Values
Constructor Detail

NullAgent

public NullAgent(int nextId,
                 int nodeId)
Constructor.

Parameters:
nextId - The next available globally unique identifer.
nodeId - The unique identifier of the node on which this Agent resides.
Method Detail

setAcceptableAgents

private void setAcceptableAgents()
Sets the Vector of acceptable agents to which this Agent may connect.


toString

public java.lang.String toString()
Returns a String representation of this class.

Overrides:
toString in class java.lang.Object
Returns:
A String representation of this class.

isConnected

public boolean isConnected()
Returns True if the current Agent is connect to another Agent.

Overrides:
isConnected in class Agent
Returns:
True if the current Agent is connect to another Agent.

setAgentProperties

public void setAgentProperties()
Sets this Agent's properties. The NullAgent has no additional properties, so a status bar message will be generated telling the user so.

Specified by:
setAgentProperties in class Agent

writeAgentProperties

public java.lang.String writeAgentProperties()
Description copied from class: Agent
Returns a TCP representation of the Agent's properties.

Specified by:
writeAgentProperties in class Agent
Returns:
Returns a TCP representation of the Agent's properties.