report
Class ContactTimesReport.ConnectionInfo

java.lang.Object
  extended by report.ContactTimesReport.ConnectionInfo
Enclosing class:
ContactTimesReport

protected class ContactTimesReport.ConnectionInfo
extends java.lang.Object

Objects of this class store time information about contacts.


Constructor Summary
ContactTimesReport.ConnectionInfo(DTNHost h1, DTNHost h2)
           
 
Method Summary
 void connectionEnd()
          Should be called when the connection ended to record the time.
 boolean equals(java.lang.Object other)
          Returns true if the other connection info contains the same hosts.
 double getConnectionTime()
          Returns the time that passed between creation of this info and call to connectionEnd().
 int hashCode()
          Returns the same hash for ConnectionInfos that have the same two hosts.
 java.lang.String toString()
          Returns a string representation of the info object
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContactTimesReport.ConnectionInfo

public ContactTimesReport.ConnectionInfo(DTNHost h1,
                                         DTNHost h2)
Method Detail

connectionEnd

public void connectionEnd()
Should be called when the connection ended to record the time. Otherwise getConnectionTime() will use end time as the time of the request.


getConnectionTime

public double getConnectionTime()
Returns the time that passed between creation of this info and call to connectionEnd(). Unless connectionEnd() is called, the difference between start time and current sim time is returned.

Returns:
The amount of simulated seconds passed between creation of this info and calling connectionEnd()

equals

public boolean equals(java.lang.Object other)
Returns true if the other connection info contains the same hosts.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Returns the same hash for ConnectionInfos that have the same two hosts.

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code

toString

public java.lang.String toString()
Returns a string representation of the info object

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the info object