org.xnap.transfer
Class DefaultSegment

java.lang.Object
  extended by org.xnap.transfer.DefaultSegment
All Implemented Interfaces:
Segment
Direct Known Subclasses:
OvernetSegment

public class DefaultSegment
extends java.lang.Object
implements Segment


Constructor Summary
DefaultSegment(long total)
           
DefaultSegment(long start, long end, long transferred, int availability)
           
DefaultSegment(long total, long start, long end, long transferred, int availability)
           
 
Method Summary
 void commit(int transferred)
           
 int getAvailability()
           
 long getEnd()
           
 long getStart()
           
 long getTotal()
           
 long getTransferred()
           
 void setAvailability(int avail)
           
 void setEnd(long l)
           
 void setStart(long l)
           
 void setTotal(long l)
           
 void setTransferred(long l)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSegment

public DefaultSegment(long total,
                      long start,
                      long end,
                      long transferred,
                      int availability)
Parameters:
start - the start offset of the segment in byte
end - the end offset of the segment in byte
transferred - the number of bytes transferred

DefaultSegment

public DefaultSegment(long start,
                      long end,
                      long transferred,
                      int availability)
Parameters:
start - the start offset of the segment in byte
end - the end offset of the segment in byte
transferred - the number of bytes transferred

DefaultSegment

public DefaultSegment(long total)
Method Detail

commit

public void commit(int transferred)

getAvailability

public int getAvailability()
Specified by:
getAvailability in interface Segment
Returns:
a number between 0 (= not available) and 255 (= high availability)

getEnd

public long getEnd()
Specified by:
getEnd in interface Segment
Returns:
the end

getStart

public long getStart()
Specified by:
getStart in interface Segment
Returns:
the start

getTotal

public long getTotal()
Specified by:
getTotal in interface Segment
Returns:
the total byte

getTransferred

public long getTransferred()
Specified by:
getTransferred in interface Segment
Returns:
transferred bytes

setAvailability

public void setAvailability(int avail)

setEnd

public void setEnd(long l)
Parameters:
l -

setStart

public void setStart(long l)
Parameters:
l -

setTotal

public void setTotal(long l)

setTransferred

public void setTransferred(long l)
Parameters:
l -


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