Interface DiffList<T extends Comparable<Integer>>
- Type Parameters:
T- Type of the object in this list.
- All Superinterfaces:
Iterable<T>
- All Known Implementing Classes:
DiffListByArrayList,DiffListBySkipList
This interface defines the methods used to store and manage InodeDiffs.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an element at the beginning of the list.booleanAdds an element at the end of the list.intbinarySearch(int key) Searches the list for the specified object using the binary search algorithm.static <T extends Comparable<Integer>>
DiffList<T>Returns an empty DiffList.get(int index) Returns the element at the specified position in this list.getMinListForRange(int startIndex, int endIndex, INodeDirectory dir) Returns the list of minimal list of elements need to combine to generate cumulative sum from startIndex to endIndex.booleanisEmpty()Returns true if this list contains no elements.remove(int index) Removes the element at the specified position in this list.intsize()Returns the number of elements in this list.static <T extends Comparable<Integer>>
DiffList<T>unmodifiableList(DiffList<T> diffs) Returns an unmodifiable diffList.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Field Details
-
EMPTY_LIST
-
-
Method Details
-
emptyList
Returns an empty DiffList. -
unmodifiableList
Returns an unmodifiable diffList.- Type Parameters:
T- Type of the object in the the diffList- Parameters:
diffs- DiffList- Returns:
- Unmodifiable diffList
-
get
Returns the element at the specified position in this list.- Parameters:
index- index of the element to return- Returns:
- the element at the specified position in this list
- Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= size())
-
isEmpty
boolean isEmpty()Returns true if this list contains no elements.- Returns:
- true if this list contains no elements
-
size
int size()Returns the number of elements in this list.- Returns:
- the number of elements in this list.
-
remove
Removes the element at the specified position in this list.- Parameters:
index- the index of the element to be removed- Returns:
- the element previously at the specified position
-
addLast
Adds an element at the end of the list.- Parameters:
t- element to be appended to this list- Returns:
- true, if insertion is successful
-
addFirst
Adds an element at the beginning of the list.- Parameters:
t- element to be added to this list
-
binarySearch
int binarySearch(int key) Searches the list for the specified object using the binary search algorithm.- Parameters:
key- key to be searched for- Returns:
- the index of the search key, if it is contained in the list otherwise, (-insertion point - 1).
-
getMinListForRange
Returns the list of minimal list of elements need to combine to generate cumulative sum from startIndex to endIndex.- Parameters:
startIndex-endIndex-- Returns:
- list of T
-