Class Range
- java.lang.Object
-
- org.jivesoftware.smackx.jingle_filetransfer.element.Range
-
- All Implemented Interfaces:
Element
,FullyQualifiedElement
,NamedElement
,XmlLangElement
public class Range extends java.lang.Object implements FullyQualifiedElement
RangeElement which specifies, which range of a file shall be transferred.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATTR_LENGTH
static java.lang.String
ATTR_OFFSET
static java.lang.String
ELEMENT
static java.lang.String
NAMESPACE
-
Constructor Summary
Constructors Constructor 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(java.lang.Integer offset, java.lang.Integer length, HashElement hash)
Create a Range element with specified offset, length and hash.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
java.lang.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.java.lang.String
getNamespace()
Returns the root element XML namespace.int
getOffset()
Return the index of the offset.int
hashCode()
java.lang.CharSequence
toXML(XmlEnvironment enclosingNamespace)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jivesoftware.smack.packet.FullyQualifiedElement
getLanguage, getQName
-
-
-
-
Field Detail
-
ELEMENT
public static final java.lang.String ELEMENT
- See Also:
- Constant Field Values
-
NAMESPACE
public static final java.lang.String NAMESPACE
- See Also:
- Constant Field Values
-
ATTR_OFFSET
public static final java.lang.String ATTR_OFFSET
- See Also:
- Constant Field Values
-
ATTR_LENGTH
public static final java.lang.String ATTR_LENGTH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Range
public Range()
Create a Range element with default values.
-
Range
public Range(int length)
Create a Range element with specified length.- Parameters:
length
- length of the transmitted data in bytes.
-
Range
public Range(int offset, int length)
Create a Range element with specified offset and length.- Parameters:
offset
- offset in bytes from the beginning of the transmitted data.length
- number of bytes that shall be transferred.
-
Range
public Range(java.lang.Integer offset, java.lang.Integer length, HashElement hash)
Create a Range element with specified offset, length and hash.- Parameters:
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.
-
-
Method Detail
-
getOffset
public int getOffset()
Return the index of the offset. This marks the begin of the specified range.- Returns:
- offset TODO javadoc me please
-
getLength
public int getLength()
Return the length of the range.- Returns:
- length TODO javadoc me please
-
getHash
public HashElement getHash()
Return the hash element that contains a checksum of the bytes specified in the range.- Returns:
- hash element
-
getElementName
public java.lang.String getElementName()
Description copied from interface:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
getNamespace
public java.lang.String getNamespace()
Description copied from interface:FullyQualifiedElement
Returns the root element XML namespace.- Specified by:
getNamespace
in interfaceFullyQualifiedElement
- Returns:
- the namespace.
-
toXML
public java.lang.CharSequence toXML(XmlEnvironment enclosingNamespace)
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-