LimeWire Consolidated API

com.limegroup.gnutella
Class EndpointData

java.lang.Object
  extended by com.limegroup.gnutella.Endpoint
      extended by com.limegroup.gnutella.EndpointData
All Implemented Interfaces:
Serializable, Cloneable, Address, Connectable, IpPort

public class EndpointData
extends Endpoint
implements Cloneable, Serializable

Simple serializable wrapper for Endpoint.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.limewire.io.IpPort
IpPort.IpComparator, IpPort.IpPortComparator
 
Nested classes/interfaces inherited from interface org.limewire.io.Address
Address.EventType
 
Field Summary
 
Fields inherited from interface org.limewire.io.Connectable
COMPARATOR, EMPTY_LIST, EMPTY_SET
 
Fields inherited from interface org.limewire.io.IpPort
IP_COMPARATOR
 
Constructor Summary
EndpointData(byte[] hostBytes, int port)
          Creates a new EndpointData instance
EndpointData(byte[] hostBytes, int port, long speed)
          Creates a new EndpointData instance
EndpointData(byte[] hostBytes, int port, long files, long kbytes)
          Creates a new EndpointData instance
EndpointData(Endpoint endpoint)
          Creates a new EndpointData instance from another endpoint
EndpointData(Endpoint endpoint, long speed)
          Creates a new EndpointData instance
EndpointData(String hostname, int port)
          Creates a new EndpointData instance
 
Method Summary
 long getSpeed()
          returns the speed of the host
 void setSpeed(long speed)
          Sets the speed and clientGUID for the host this endpoint refers to
 
Methods inherited from class com.limegroup.gnutella.Endpoint
clone, equals, getAddress, getAddressDescription, getFiles, getHostBytes, getInetAddress, getInetSocketAddress, getKbytes, getPort, hashCode, isSameSubnet, isTLSCapable, isUDPHostCache, normalizeFilesAndSize, setFiles, setHostname, setKbytes, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EndpointData

public EndpointData(Endpoint endpoint)
Creates a new EndpointData instance from another endpoint

Parameters:
endpoint - from where to copy the fields

EndpointData

public EndpointData(String hostname,
                    int port)
Creates a new EndpointData instance

Parameters:
hostname - Hostname of the node this endpoint refers to
port - The port number for the host

EndpointData

public EndpointData(byte[] hostBytes,
                    int port)
Creates a new EndpointData instance

Parameters:
hostBytes - IP address of the host (MSB first)
port - The port number for the host

EndpointData

public EndpointData(byte[] hostBytes,
                    int port,
                    long speed)
Creates a new EndpointData instance

Parameters:
hostBytes - IP address of the host (MSB first)
port - The port number for the host
speed - Spped in kbps of the host

EndpointData

public EndpointData(byte[] hostBytes,
                    int port,
                    long files,
                    long kbytes)
Creates a new EndpointData instance

Parameters:
hostBytes - IP address of the host (MSB first)
port - The port number for the host
files - the number of files the host has
kbytes - the size of all of the files, in kilobytes

EndpointData

public EndpointData(Endpoint endpoint,
                    long speed)
Creates a new EndpointData instance

Parameters:
endpoint - from where to copy the fields for the super class
speed - Speed of the host
clientGUID - Unique GUID for the host
Method Detail

getSpeed

public long getSpeed()
returns the speed of the host


setSpeed

public void setSpeed(long speed)
Sets the speed and clientGUID for the host this endpoint refers to

Parameters:
speed - Speed of the host

LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.