org.xnap.peer
Class AbstractPeer

java.lang.Object
  extended by org.xnap.peer.AbstractPeer
All Implemented Interfaces:
Peer
Direct Known Subclasses:
GiFTUser, JOscarPeer, JTellaServant, LimeWireServant, OpenNapUser, OvernetPeer, PircBotPeer

public abstract class AbstractPeer
extends java.lang.Object
implements Peer

This class provides the default implementation for a peer.


Constructor Summary
AbstractPeer(java.lang.String name)
           
 
Method Summary
 java.lang.String getClientInfo()
          Returns the client info.
 int getFileCount()
          Returns the number of shared files by this peer.
 int getLinkSpeed()
          Returns the link speed of the peer.
 java.lang.String getName()
          Returns the name of the peer.
 void setClientInfo(java.lang.String newValue)
           
 void setFileCount(int newValue)
           
 void setLinkSpeed(int newValue)
           
 void setName(java.lang.String name)
           
 java.lang.String toString()
          Returns the value of getName().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xnap.peer.Peer
getActions, getHost, getLocalDownloadCount, getLocalUploadCount, getStatus
 

Constructor Detail

AbstractPeer

public AbstractPeer(java.lang.String name)
Method Detail

getClientInfo

public java.lang.String getClientInfo()
Description copied from interface: Peer
Returns the client info. This is the name of the peer's software, e.g. "XNap 2.4"

Specified by:
getClientInfo in interface Peer
Returns:
null, if the client info is unknown; the client info, otherwise

getFileCount

public int getFileCount()
Description copied from interface: Peer
Returns the number of shared files by this peer.

Specified by:
getFileCount in interface Peer
Returns:
-1, if the file count is unknown; the count, otherwise

getLinkSpeed

public int getLinkSpeed()
Description copied from interface: Peer
Returns the link speed of the peer.

Specified by:
getLinkSpeed in interface Peer
Returns:
-1, if the link speed is unknown; the speed in kb/s, otherwise

getName

public java.lang.String getName()
Description copied from interface: Peer
Returns the name of the peer.

Specified by:
getName in interface Peer

setClientInfo

public void setClientInfo(java.lang.String newValue)

setFileCount

public void setFileCount(int newValue)

setLinkSpeed

public void setLinkSpeed(int newValue)

setName

public void setName(java.lang.String name)

toString

public java.lang.String toString()
Returns the value of getName().

Overrides:
toString in class java.lang.Object


Copyright © 2001-2005 XNap Team. All Rights Reserved.