|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.colorado.cs.ns2.sim.Connection
public class Connection
This class provides the binding between two Agents in the form of a Connection.
Field Summary | |
---|---|
private Agent |
agent1
The first Agent party in the Connection. |
private Agent |
agent2
The second Agent party in the Connection. |
private boolean |
isConnected
The status of the Connection. |
private static long |
serialVersionUID
Generated serial version UID. |
Constructor Summary | |
---|---|
Connection(Agent a1,
Agent a2)
Two-argument constructor. |
|
Connection(Agent a1,
Agent a2,
boolean isConnected)
Three-argument constructor. |
Method Summary | |
---|---|
boolean |
areAgentsConnected()
Returns True if the agents are connected. |
void |
connectAgents()
Connect the agents. |
void |
disconnectAgents()
Disconnect the agents. |
Agent |
getAgent1()
Returns the first Agent. |
Agent |
getAgent2()
Returns the second Agent. |
void |
setAgent1(Agent agent1)
Sets the first Agent. |
void |
setAgent2(Agent agent2)
Sets the second Agent. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private Agent agent1
private Agent agent2
private boolean isConnected
Constructor Detail |
---|
public Connection(Agent a1, Agent a2)
a1
- Agent 1.a2
- Agent 2.public Connection(Agent a1, Agent a2, boolean isConnected)
a1
- Agent 1.a2
- Agent 2.isConnected
- The connection status. True if the agents are connected.Method Detail |
---|
public Agent getAgent1()
public void setAgent1(Agent agent1)
agent1
- A new Agent 1.public Agent getAgent2()
public void setAgent2(Agent agent2)
agent2
- A new Agent 2.public boolean areAgentsConnected()
public void connectAgents()
public void disconnectAgents()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |