public class Range extends Object
Modifier and Type | Field and Description |
---|---|
static long |
INDEX_FIRST
Index for the first byte of an entity.
|
static long |
INDEX_LAST
Index for the last byte of an entity.
|
static long |
SIZE_MAX
Maximum size available from the index.
|
Constructor and Description |
---|
Range()
Default constructor defining a range starting on the first byte and with
a maximum size, i.e.
|
Range(long size)
Constructor defining a range starting on the first byte and with the
given size.
|
Range(long index,
long size)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object) |
long |
getIndex()
Returns the index from which to start the range.
|
long |
getSize()
Returns the size of the range in number of bytes.
|
boolean |
isIncluded(long position,
long totalSize)
Indicates if the given index is included in the range.
|
void |
setIndex(long index)
Sets the index from which to start the range.
|
void |
setSize(long size)
Sets the size of the range in number of bytes.
|
public static final long INDEX_FIRST
public static final long INDEX_LAST
public static final long SIZE_MAX
public Range()
public Range(long size)
size
- Size of the range in number of bytes.public Range(long index, long size)
index
- Index from which to start the rangesize
- Size of the range in number of bytes.public long getIndex()
INDEX_FIRST
(0), starting at the first
byte.public long getSize()
public boolean isIncluded(long position, long totalSize)
position
- The position to test.totalSize
- public void setIndex(long index)
INDEX_FIRST
(0), starting at the first byteindex
- The index from which to start the range.public void setSize(long size)
size
- The size of the range in number of bytes.Copyright © 2005–2013. All rights reserved.