viceroy
Class LookupMessageStatisticsImpl

java.lang.Object
  |
  +--viceroy.LookupMessageStatisticsImpl
All Implemented Interfaces:
LookupMessageStatistics, MessageStatistics, java.io.Serializable

class LookupMessageStatisticsImpl
extends java.lang.Object
implements LookupMessageStatistics, java.io.Serializable

A simple implementation class of LookupMessageStatistics

Since:
1.65
Author:
Anat Talmy
, Oren Dobzinski

Field Summary
private  LookupState lookupState
           
private  ViceroyPeer peer
           
private  long time
           
private  Relative type
           
 
Constructor Summary
LookupMessageStatisticsImpl(ViceroyPeer _peer)
          Creates the first in path
LookupMessageStatisticsImpl(ViceroyPeer _peer, Relative _type, LookupState _lookupState)
          a constructor
 
Method Summary
 boolean equals(java.lang.Object other)
          true if this equals other
 Relative getConnectionType()
          Gets the type of the connection that this peer function as, to the previous one, and caused the mesaage sending to this peer.
 LookupState getLookupState()
          Gets the state of the lookup
 ViceroyPeer getPeer()
          Gets the visited peer
 long getVisitTime()
          Gets the time that this peer was visited, as returned from System.currentTimeMillis()
 int hashCode()
          returns the hashcode
 java.lang.String toString()
          tostring
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

peer

private ViceroyPeer peer

type

private Relative type

time

private long time

lookupState

private LookupState lookupState
Constructor Detail

LookupMessageStatisticsImpl

public LookupMessageStatisticsImpl(ViceroyPeer _peer,
                                   Relative _type,
                                   LookupState _lookupState)
a constructor

Parameters:
_peer - the peer
_type - the type of relative
_lookupState - the state of the lookup

LookupMessageStatisticsImpl

public LookupMessageStatisticsImpl(ViceroyPeer _peer)
Creates the first in path

Parameters:
_peer - the first peer in path
Method Detail

getPeer

public ViceroyPeer getPeer()
Gets the visited peer

Specified by:
getPeer in interface MessageStatistics
Returns:
the visited peer

getConnectionType

public Relative getConnectionType()
Gets the type of the connection that this peer function as, to the previous one, and caused the mesaage sending to this peer. For example, if a this peer function both as parent and successor of some other peer, the type returned here is the one that caused this peer to get this message (according to the lookup stage, etc.)

Specified by:
getConnectionType in interface MessageStatistics
Returns:
the type of the connection that this peer function as, to the previous one. Null is a legal value, if this is the first in path
See Also:
Connection

getVisitTime

public long getVisitTime()
Gets the time that this peer was visited, as returned from System.currentTimeMillis()

Specified by:
getVisitTime in interface MessageStatistics
Returns:
the time that this peer was visited, as returned from System.currentTimeMillis()

getLookupState

public LookupState getLookupState()
Gets the state of the lookup

Specified by:
getLookupState in interface LookupMessageStatistics
Returns:
the state of the lookup Null is a legal value, if this is the first in path
See Also:
LookupState

equals

public boolean equals(java.lang.Object other)
true if this equals other

Overrides:
equals in class java.lang.Object
Parameters:
other -
Returns:

hashCode

public int hashCode()
returns the hashcode

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

toString

public java.lang.String toString()
tostring

Overrides:
toString in class java.lang.Object
Returns: