Schnittstelle LongList

Alle Superschnittstellen:
Collection<Long>, ISizeProvider, Iterable<Long>, List<Long>, LongCollection, LongIterable
Alle bekannten Implementierungsklassen:
AbstractLongList, CopyOnWriteLongArrayList, ImmutableLongList, LongArrayList, LongLinkedList

public interface LongList extends LongCollection, List<Long>
A Type Specific List interface that reduces boxing/unboxing and adds a couple extra quality of life features
  • Methodendetails

    • add

      boolean add(long e)
      A Type-Specific add Function to reduce (un)boxing
      Angegeben von:
      add in Schnittstelle LongCollection
      Parameter:
      e - the element to add
      Gibt zurück:
      true if the list was modified
      Siehe auch:
    • add

      void add(int index, long e)
      A Type-Specific add Function to reduce (un)boxing
      Parameter:
      index - index at which the specified element is to be inserted
      e - the element to add
      Siehe auch:
    • addIfAbsent

      default boolean addIfAbsent(long e)
      A Helper function that will only add elements if it is not present.
      Parameter:
      e - the element to add
      Gibt zurück:
      true if the list was modified
    • addIfPresent

      default boolean addIfPresent(long e)
      A Helper function that will only add elements if it is present.
      Parameter:
      e - the element to add
      Gibt zurück:
      true if the list was modified
    • addAll

      boolean addAll(int index, LongCollection c)
      A Type-Specific addAll Function to reduce (un)boxing
      Parameter:
      index - index at which the specified elements is to be inserted
      c - the elements that need to be added
      Gibt zurück:
      true if the list was modified
      Siehe auch:
    • addAll

      boolean addAll(LongList c)
      A Type-Specific and optimized addAll function that allows a faster transfer of elements
      Parameter:
      c - the elements that need to be added
      Gibt zurück:
      true if the list was modified
    • addAll

      boolean addAll(int index, LongList c)
      A Type-Specific and optimized addAll function that allows a faster transfer of elements
      Parameter:
      index - index at which the specified elements is to be inserted
      c - the elements that need to be added
      Gibt zurück:
      true if the list was modified
    • getFirstLong

      default long getFirstLong()
      Helper method that returns the first element of a List. This function was introduced due to how annoying it is to get/remove the last element of a list. This simplifies this process a bit.
      Gibt zurück:
      first element of the list
    • getLastLong

      default long getLastLong()
      Helper method that returns the last element of a List. This function was introduced due to how annoying it is to get/remove the last element of a list. This simplifies this process a bit.
      Gibt zurück:
      last element of the list
    • removeFirstLong

      default long removeFirstLong()
      Helper method that removes and returns the first element of a List. This function was introduced due to how annoying it is to get/remove the last element of a list. This simplifies this process a bit.
      Gibt zurück:
      first element of the list and removes it
    • removeLastLong

      default long removeLastLong()
      Helper method that removes and returns the last element of a List. This function was introduced due to how annoying it is to get/remove the last element of a list. This simplifies this process a bit.
      Gibt zurück:
      last element of the list and removes it
    • getLong

      long getLong(int index)
      A Type-Specific get function to reduce (un)boxing
      Parameter:
      index - the index of the value that is requested
      Gibt zurück:
      the value at the given index
      Löst aus:
      IndexOutOfBoundsException - if the index is not within the list range
      Siehe auch:
    • set

      long set(int index, long e)
      A Type-Specific set function to reduce (un)boxing
      Parameter:
      index - index of the element to replace
      e - element to be stored at the specified position
      Gibt zurück:
      the element previously at the specified position
      Löst aus:
      IndexOutOfBoundsException - if the index is not within the list range
      Siehe auch:
    • removeLong

      long removeLong(int index)
      A Type-Specific remove function to reduce (un)boxing
      Parameter:
      index - the index of the element to be removed
      Gibt zurück:
      the element previously at the specified position
      Siehe auch:
    • indexOf

      int indexOf(long e)
      A Type-Specific indexOf function to reduce (un)boxing
      Parameter:
      e - the element that is searched for
      Gibt zurück:
      the index of the element if found. (if not found then -1)
      Note:
      does not support null values
    • lastIndexOf

      int lastIndexOf(long e)
      A Type-Specific lastIndexOf function to reduce (un)boxing
      Parameter:
      e - the element that is searched for
      Gibt zurück:
      the lastIndex of the element if found. (if not found then -1)
      Note:
      does not support null values
    • replaceLongs

      default void replaceLongs(LongUnaryOperator o)
      A Type-Specific replace function to reduce (un)boxing
      Parameter:
      o - the action to replace the values
      Löst aus:
      NullPointerException - if o is null
    • addElements

      default void addElements(long... a)
      A function to fast add elements to the list
      Parameter:
      a - the elements that should be added
      Löst aus:
      IndexOutOfBoundsException - if from is outside of the lists range
    • addElements

      default void addElements(int from, long... a)
      A function to fast add elements to the list
      Parameter:
      from - the index where the elements should be added into the list
      a - the elements that should be added
      Löst aus:
      IndexOutOfBoundsException - if from is outside of the lists range
    • addElements

      void addElements(int from, long[] a, int offset, int length)
      A function to fast add elements to the list
      Parameter:
      from - the index where the elements should be added into the list
      a - the elements that should be added
      offset - the start index of the array should be read from
      length - how many elements should be read from
      Löst aus:
      IndexOutOfBoundsException - if from is outside of the lists range
    • getElements

      default long[] getElements(int from, long[] a)
      A function to fast fetch elements from the list
      Parameter:
      from - index where the list should be fetching elements from
      a - the array where the values should be inserted to
      Gibt zurück:
      the inputArray
      Löst aus:
      NullPointerException - if the array is null
      IndexOutOfBoundsException - if from is outside of the lists range
      IllegalStateException - if offset or length are smaller then 0 or exceed the array length
    • getElements

      long[] getElements(int from, long[] a, int offset, int length)
      A function to fast fetch elements from the list
      Parameter:
      from - index where the list should be fetching elements from
      a - the array where the values should be inserted to
      offset - the startIndex of where the array should be written to
      length - the number of elements the values should be fetched from
      Gibt zurück:
      the inputArray
      Löst aus:
      NullPointerException - if the array is null
      IndexOutOfBoundsException - if from is outside of the lists range
      IllegalStateException - if offset or length are smaller then 0 or exceed the array length
    • removeElements

      void removeElements(int from, int to)
      a function to fast remove elements from the list.
      Parameter:
      from - the start index of where the elements should be removed from (inclusive)
      to - the end index of where the elements should be removed to (exclusive)
    • swapRemove

      long swapRemove(int index)
      A Highly Optimized remove function that removes the desired element. But instead of shifting the elements to the left it moves the last element to the removed space.
      Parameter:
      index - the index of the element to be removed
      Gibt zurück:
      the element previously at the specified position
    • swapRemoveLong

      boolean swapRemoveLong(long e)
      A Highly Optimized remove function that removes the desired element. But instead of shifting the elements to the left it moves the last element to the removed space.
      Parameter:
      e - the element that should be removed
      Gibt zurück:
      true if the element was removed
    • extractElements

      long[] extractElements(int from, int to)
      A function to fast extract elements out of the list, this removes the elements that were fetched.
      Parameter:
      from - the start index of where the elements should be fetched from (inclusive)
      to - the end index of where the elements should be fetched to (exclusive)
      Gibt zurück:
      a array of the elements that were fetched
    • fillBuffer

      default void fillBuffer(LongBuffer buffer)
      Helper function that allows to fastFill a buffer reducing the duplication requirement
      Parameter:
      buffer - where the data should be stored in.
    • sort

      @Deprecated default void sort(Comparator<? super Long> c)
      Veraltet.
      Please use the corresponding type-specific function instead.

      This default implementation delegates to the corresponding type-specific function.

      Angegeben von:
      sort in Schnittstelle List<Long>
    • sort

      default void sort(LongComparator c)
      Sorts the elements specified by the Natural order either by using the Comparator or the elements
      Parameter:
      c - the sorter of the elements, can be null
      Siehe auch:
    • unstableSort

      @Deprecated default void unstableSort(Comparator<? super Long> c)
      Veraltet.
      Please use the corresponding type-specific function instead.

      This default implementation delegates to the corresponding type-specific function.

      Parameter:
      c - the sorter of the elements, can be null
    • unstableSort

      default void unstableSort(LongComparator c)
      Sorts the elements specified by the Natural order either by using the Comparator or the elements using a unstable sort
      Parameter:
      c - the sorter of the elements, can be null
      Siehe auch:
    • forEachIndexed

      default void forEachIndexed(IntLongConsumer action)
      A Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.
      Angegeben von:
      forEachIndexed in Schnittstelle LongIterable
      Parameter:
      action - The action to be performed for each element
      Löst aus:
      NullPointerException - if the specified action is null
    • listIterator

      LongListIterator listIterator()
      A Type-Specific Iterator of listIterator
      Angegeben von:
      listIterator in Schnittstelle List<Long>
      Siehe auch:
    • listIterator

      LongListIterator listIterator(int index)
      A Type-Specific Iterator of listIterator
      Angegeben von:
      listIterator in Schnittstelle List<Long>
      Siehe auch:
    • indexedIterator

      LongListIterator indexedIterator(int... indecies)
      Creates a Iterator that follows the indecies provided.
      For example if the Lists Contents is:
      -1, 0 1
      and the indecies are:
      0, 1, 2, 2, 1, 0
      then the iterator will return the following values:
      -1, 0, 1, 1, 0, -1
      Parameter:
      indecies - that should be used for the iteration.
      Gibt zurück:
      a custom indexed iterator
    • indexedIterator

      LongListIterator indexedIterator(IntList indecies)
      Creates a Iterator that follows the indecies provided.
      For example if the Lists Contents is:
      -1, 0 1
      and the indecies are:
      0, 1, 2, 2, 1, 0
      then the iterator will return the following values:
      -1, 0, 1, 1, 0, -1
      Parameter:
      indecies - that should be used for the iteration.
      Gibt zurück:
      a custom indexed iterator
    • subList

      LongList subList(int from, int to)
      A Type-Specific List of subList
      Angegeben von:
      subList in Schnittstelle List<Long>
      Siehe auch:
    • reversed

      LongList reversed()
      A Type-Specific List Helper that shows all elements in reverse.
      Gibt zurück:
      a list wrapper that has all elements reversed!
    • synchronize

      default LongList synchronize()
      Creates a Wrapped List that is Synchronized
      Angegeben von:
      synchronize in Schnittstelle LongCollection
      Gibt zurück:
      a new List that is synchronized
      Siehe auch:
    • synchronize

      default LongList synchronize(Object mutex)
      Creates a Wrapped List that is Synchronized
      Angegeben von:
      synchronize in Schnittstelle LongCollection
      Parameter:
      mutex - is the controller of the synchronization block
      Gibt zurück:
      a new List Wrapper that is synchronized
      Siehe auch:
    • unmodifiable

      default LongList unmodifiable()
      Creates a Wrapped List that is unmodifiable
      Angegeben von:
      unmodifiable in Schnittstelle LongCollection
      Gibt zurück:
      a new List Wrapper that is unmodifiable
      Siehe auch:
    • size

      void size(int size)
      A function to ensure the elements are within the requested size. If smaller then the stored elements they get removed as needed. If bigger it is ensured that enough room is provided depending on the implementation
      Parameter:
      size - the requested amount of elements/room for elements
    • copy

      LongList copy()
      Beschreibung aus Schnittstelle kopiert: LongCollection
      A Function that does a shallow clone of the Collection itself. This function is more optimized then a copy constructor since the Collection does not have to be unsorted/resorted. It can be compared to Cloneable but with less exception risk
      Angegeben von:
      copy in Schnittstelle LongCollection
      Gibt zurück:
      a Shallow Copy of the collection
    • add

      @Deprecated default boolean add(Long e)
      Veraltet.
      Please use the corresponding type-specific function instead.

      This default implementation delegates to the corresponding type-specific function.

      This default implementation delegates to the corresponding type-specific function.

      Angegeben von:
      add in Schnittstelle Collection<Long>
      Angegeben von:
      add in Schnittstelle List<Long>
      Angegeben von:
      add in Schnittstelle LongCollection
    • get

      @Deprecated default Long get(int index)
      Veraltet.
      Please use the corresponding type-specific function instead.

      This default implementation delegates to the corresponding type-specific function.

      Angegeben von:
      get in Schnittstelle List<Long>
    • set

      @Deprecated default Long set(int index, Long e)
      Veraltet.
      Please use the corresponding type-specific function instead.

      This default implementation delegates to the corresponding type-specific function.

      Angegeben von:
      set in Schnittstelle List<Long>
    • indexOf

      @Deprecated default int indexOf(Object o)
      Veraltet.
      Please use the corresponding type-specific function instead.

      This default implementation delegates to the corresponding type-specific function.

      Angegeben von:
      indexOf in Schnittstelle List<Long>
    • lastIndexOf

      @Deprecated default int lastIndexOf(Object o)
      Veraltet.
      Please use the corresponding type-specific function instead.

      This default implementation delegates to the corresponding type-specific function.

      Angegeben von:
      lastIndexOf in Schnittstelle List<Long>
    • contains

      @Deprecated default boolean contains(Object o)
      Veraltet.
      Please use the corresponding type-specific function instead.

      This default implementation delegates to the corresponding type-specific function.

      This default implementation delegates to the corresponding type-specific function.

      Angegeben von:
      contains in Schnittstelle Collection<Long>
      Angegeben von:
      contains in Schnittstelle List<Long>
      Angegeben von:
      contains in Schnittstelle LongCollection
    • remove

      @Deprecated default boolean remove(Object o)
      Veraltet.
      Please use the corresponding type-specific function instead.

      This default implementation delegates to the corresponding type-specific function.

      This default implementation delegates to the corresponding type-specific function.

      Angegeben von:
      remove in Schnittstelle Collection<Long>
      Angegeben von:
      remove in Schnittstelle List<Long>
      Angegeben von:
      remove in Schnittstelle LongCollection
    • remove

      @Deprecated default Long remove(int index)
      Veraltet.
      Please use the corresponding type-specific function instead.

      This default implementation delegates to the corresponding type-specific function.

      Angegeben von:
      remove in Schnittstelle List<Long>
    • replaceAll

      @Deprecated default void replaceAll(UnaryOperator<Long> o)
      Veraltet.
      Please use the corresponding type-specific function instead.

      This default implementation delegates to the corresponding type-specific function.

      Angegeben von:
      replaceAll in Schnittstelle List<Long>
    • spliterator

      default LongSplititerator spliterator()
      A Type Specific Type Splititerator to reduce boxing/unboxing
      Angegeben von:
      spliterator in Schnittstelle Collection<Long>
      Angegeben von:
      spliterator in Schnittstelle Iterable<Long>
      Angegeben von:
      spliterator in Schnittstelle List<Long>
      Angegeben von:
      spliterator in Schnittstelle LongCollection
      Angegeben von:
      spliterator in Schnittstelle LongIterable
      Gibt zurück:
      type specific splititerator