public final class RangedUri extends Object
| Modifier and Type | Field and Description |
|---|---|
long |
length
The length of the range, or
C.LENGTH_UNSET to indicate that the range is unbounded. |
long |
start
The (zero based) index of the first byte of the range.
|
| Constructor and Description |
|---|
RangedUri(String referenceUri,
long start,
long length)
Constructs an ranged uri.
|
| Modifier and Type | Method and Description |
|---|---|
RangedUri |
attemptMerge(RangedUri other,
String baseUri)
Attempts to merge this
RangedUri with another and an optional common base uri. |
boolean |
equals(Object obj) |
int |
hashCode() |
Uri |
resolveUri(String baseUri)
Returns the resolved
Uri represented by the instance. |
String |
resolveUriString(String baseUri)
Returns the resolved uri represented by the instance as a string.
|
public final long start
public final long length
C.LENGTH_UNSET to indicate that the range is unbounded.public RangedUri(String referenceUri, long start, long length)
referenceUri - The reference uri.start - The (zero based) index of the first byte of the range.length - The length of the range, or C.LENGTH_UNSET to indicate that the range is
unbounded.public Uri resolveUri(String baseUri)
Uri represented by the instance.baseUri - The base Uri.Uri represented by the instance.public String resolveUriString(String baseUri)
baseUri - The base Uri.public RangedUri attemptMerge(RangedUri other, String baseUri)
RangedUri with another and an optional common base uri.
A merge is successful if both instances define the same Uri after resolution with the
base uri, and if one starts the byte after the other ends, forming a contiguous region with
no overlap.
If other is null then the merge is considered unsuccessful, and null is returned.