ucr.core
Class Host

java.lang.Object
  extended byucr.core.Host

public class Host
extends java.lang.Object

Contains the location of a host on the network


Field Summary
private  java.lang.String ipAddress
           
private  int port
           
private  int sharedFileCount
           
private  int sharedFileSize
           
 
Constructor Summary
Host(java.lang.String ipAddress, int port, int sharedFileCount, int sharedFileSize)
          Constructs a Host
 
Method Summary
 boolean equals(java.lang.Object obj)
          Equals comparison
(package private)  java.lang.String getIPAddress()
          Returns the address
(package private)  int getPort()
          Returns the port
(package private)  int getSharedFileCount()
          Return shared file count
(package private)  int getSharedFileSize()
          Reurn the shared file size
 int hashCode()
          Use the IP address for the hashcode
 java.lang.String toString()
          Get text based host information
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ipAddress

private java.lang.String ipAddress

port

private int port

sharedFileCount

private int sharedFileCount

sharedFileSize

private int sharedFileSize
Constructor Detail

Host

public Host(java.lang.String ipAddress,
            int port,
            int sharedFileCount,
            int sharedFileSize)
Constructs a Host

Parameters:
ipAddress - IP address
port - port
sharedFileCount - count of shared files
sharedFileSize - total shared file size in KB
Method Detail

getIPAddress

java.lang.String getIPAddress()
Returns the address


getPort

int getPort()
Returns the port


getSharedFileCount

int getSharedFileCount()
Return shared file count

Returns:
file count

getSharedFileSize

int getSharedFileSize()
Reurn the shared file size

Returns:
size in KB

equals

public boolean equals(java.lang.Object obj)
Equals comparison


hashCode

public int hashCode()
Use the IP address for the hashcode


toString

public java.lang.String toString()
Get text based host information