public class Range extends Object implements NamedElement
Modifier and Type | Field and Description |
---|---|
static String |
ATTR_LENGTH |
static String |
ATTR_OFFSET |
static String |
ELEMENT |
Constructor and Description |
---|
Range()
Create a Range element with default values.
|
Range(int length)
Create a Range element with specified length.
|
Range(int offset,
int length)
Create a Range element with specified offset and length.
|
Range(int offset,
int length,
HashElement hash)
Create a Range element with specified offset, length and hash.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
String |
getElementName()
Returns the root element name.
|
HashElement |
getHash()
Return the hash element that contains a checksum of the bytes specified in the range.
|
int |
getLength()
Return the length of the range.
|
int |
getOffset()
Return the index of the offset.
|
int |
hashCode() |
CharSequence |
toXML(String enclosingNamespace)
Returns the XML representation of this Element.
|
public static final String ELEMENT
public static final String ATTR_OFFSET
public static final String ATTR_LENGTH
public Range()
public Range(int length)
length
- length of the transmitted data in bytes.public Range(int offset, int length)
offset
- offset in bytes from the beginning of the transmitted data.length
- number of bytes that shall be transferred.public Range(int offset, int length, HashElement hash)
offset
- offset in bytes from the beginning of the transmitted data.length
- number of bytes that shall be transferred.hash
- hash of the bytes in the specified range.public int getOffset()
public int getLength()
public HashElement getHash()
public String getElementName()
NamedElement
getElementName
in interface NamedElement
public CharSequence toXML(String enclosingNamespace)
Element