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

public interface DiffList<T extends Comparable<Integer>> extends Iterable<T>
This interface defines the methods used to store and manage InodeDiffs.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final DiffList
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds an element at the beginning of the list.
    boolean
    Adds an element at the end of the list.
    int
    binarySearch(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.
    boolean
    Returns true if this list contains no elements.
    remove(int index)
    Removes the element at the specified position in this list.
    int
    Returns the number of elements in this list.
    static <T extends Comparable<Integer>>
    DiffList<T>
    Returns an unmodifiable diffList.

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator
  • Field Details

    • EMPTY_LIST

      static final DiffList EMPTY_LIST
  • Method Details

    • emptyList

      static <T extends Comparable<Integer>> DiffList<T> emptyList()
      Returns an empty DiffList.
    • unmodifiableList

      static <T extends Comparable<Integer>> DiffList<T> unmodifiableList(DiffList<T> diffs)
      Returns an unmodifiable diffList.
      Type Parameters:
      T - Type of the object in the the diffList
      Parameters:
      diffs - DiffList
      Returns:
      Unmodifiable diffList
    • get

      T get(int index)
      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

      T remove(int index)
      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

      boolean addLast(T t)
      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

      void addFirst(T t)
      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

      List<T> 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.
      Parameters:
      startIndex -
      endIndex -
      Returns:
      list of T