ucr.core
Class TraceRecord

java.lang.Object
  extended byucr.core.TraceRecord

public class TraceRecord
extends java.lang.Object

Represents information about a single file served


Field Summary
(package private)  int id
           
(package private)  java.lang.String ip
           
(package private)  int port
           
 
Constructor Summary
TraceRecord()
           
TraceRecord(int id, java.lang.String ip, int port)
          Constructs a record describing a node in the traceroute
TraceRecord(short[] payload)
          This constructor assembles a message from some little-endian encoded byte sequence that comes from the network
 
Method Summary
 byte[] getBytes()
          Flatten the FileRecord
 int getID()
          Get the id of this record
 java.lang.String getIP()
          Get the ip of this record
 int getPORT()
          Get the file name
 int size()
           
 int sizeOf()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

int id

ip

java.lang.String ip

port

int port
Constructor Detail

TraceRecord

public TraceRecord(int id,
                   java.lang.String ip,
                   int port)
Constructs a record describing a node in the traceroute

Parameters:
id - of this node
ip - of this node
port - of this node

TraceRecord

public TraceRecord()

TraceRecord

public TraceRecord(short[] payload)
This constructor assembles a message from some little-endian encoded byte sequence that comes from the network

Parameters:
payload - - some bytearray containing the sent stuff
Method Detail

getID

public int getID()
Get the id of this record

Returns:
ID

getIP

public java.lang.String getIP()
Get the ip of this record

Returns:
IP

getPORT

public int getPORT()
Get the file name

Returns:
file name

sizeOf

public int sizeOf()

size

public int size()

toString

public java.lang.String toString()

getBytes

public byte[] getBytes()
Flatten the FileRecord

Returns:
bytes