org.xnap.transfer
Class DefaultSegment
java.lang.Object
org.xnap.transfer.DefaultSegment
- All Implemented Interfaces:
- Segment
- Direct Known Subclasses:
- OvernetSegment
public class DefaultSegment
- extends java.lang.Object
- implements Segment
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultSegment
public DefaultSegment(long total,
long start,
long end,
long transferred,
int availability)
- Parameters:
start
- the start offset of the segment in byteend
- the end offset of the segment in bytetransferred
- 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 byteend
- the end offset of the segment in bytetransferred
- the number of bytes transferred
DefaultSegment
public DefaultSegment(long total)
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.