public class DiskRangeList extends DiskRange
| Modifier and Type | Class and Description |
|---|---|
static class |
DiskRangeList.CreateHelper |
static class |
DiskRangeList.MutateHelper
List in-place mutation helper - a bogus first element that is inserted before list head,
and thus remains constant even if head is replaced with some new range via in-place list
mutation.
|
| Modifier and Type | Field and Description |
|---|---|
DiskRangeList |
next |
DiskRangeList |
prev |
| Constructor and Description |
|---|
DiskRangeList(long offset,
long end) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other) |
long |
getTotalLength() |
boolean |
hasContiguousNext() |
int |
hashCode()
This class provides just a simplistic iterator interface (check
DiskRangeList). |
DiskRangeList |
insertAfter(DiskRangeList other)
Inserts an element after current in the list.
|
DiskRangeList |
insertPartAfter(DiskRangeList other)
Inserts an intersecting range after current in the list and adjusts offset accordingly.
|
DiskRangeList |
insertPartBefore(DiskRangeList other)
Inserts an intersecting range before current in the list and adjusts offset accordingly.
|
int |
listSize() |
DiskRangeList[] |
listToArray() |
void |
removeAfter()
Removes an element after current from the list.
|
void |
removeSelf()
Removes the current element from the list.
|
DiskRangeList |
replaceSelfWith(DiskRangeList other)
Replaces this element with another in the list; returns the new element.
|
void |
setEnd(long newEnd) |
DiskRangeList |
split(long cOffset)
Splits current element in the list, using DiskRange::slice.
|
static String |
stringifyDiskRanges(DiskRangeList range) |
equalRange, getData, getEnd, getLength, getOffset, hasData, merge, sliceAndShift, toStringpublic DiskRangeList prev
public DiskRangeList next
public DiskRangeList replaceSelfWith(DiskRangeList other)
other - the disk range to swap into this listpublic static final String stringifyDiskRanges(DiskRangeList range)
public DiskRangeList insertPartBefore(DiskRangeList other)
other - the element to insertpublic DiskRangeList insertAfter(DiskRangeList other)
other - the new element to insertpublic DiskRangeList insertPartAfter(DiskRangeList other)
other - the new element to insertpublic void removeAfter()
public void removeSelf()
public final DiskRangeList split(long cOffset)
cOffset - the position to split the listpublic boolean hasContiguousNext()
public int listSize()
public long getTotalLength()
public DiskRangeList[] listToArray()
public int hashCode()
DiskRangeList).
Thus, for equality/hashcode just check the actual DiskRange content.public void setEnd(long newEnd)
Copyright © 2021 The Apache Software Foundation. All rights reserved.