Klasse AbstractLongList

Alle implementierten Schnittstellen:
Iterable<Long>, Collection<Long>, List<Long>, LongCollection, LongIterable, LongList, ISizeProvider
Bekannte direkte Unterklassen:
CopyOnWriteLongArrayList, ImmutableLongList, LongArrayList, LongLinkedList

public abstract class AbstractLongList extends AbstractLongCollection implements LongList
Abstract implementation of the LongList interface.
  • Konstruktordetails

    • AbstractLongList

      public AbstractLongList()
  • Methodendetails

    • add

      public boolean add(long e)
      A Type-Specific implementation of add function that delegates to List.add(int, Object)
      Angegeben von:
      add in Schnittstelle LongCollection
      Angegeben von:
      add in Schnittstelle LongList
      Parameter:
      e - the element to add
      Gibt zurück:
      true if the list was modified
      Siehe auch:
    • add

      @Deprecated public void add(int index, Long element)
      Veraltet.
      Please use the corresponding type-specific function instead.

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

      Angegeben von:
      add in Schnittstelle List<Long>
    • addAll

      public boolean addAll(LongCollection c)
      A Type-Specific implementation that iterates over the elements and adds them.
      Angegeben von:
      addAll in Schnittstelle LongCollection
      Setzt außer Kraft:
      addAll in Klasse AbstractLongCollection
      Parameter:
      c - the elements that wants to be added
      Gibt zurück:
      true if the list was modified
    • addAll

      public boolean addAll(LongList c)
      A Type-Specific implementation that iterates over the elements and adds them.
      Angegeben von:
      addAll in Schnittstelle LongList
      Parameter:
      c - the elements that wants to be added
      Gibt zurück:
      true if the list was modified
    • addAll

      @Deprecated public boolean addAll(Collection<? extends Long> c)
      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:
      addAll in Schnittstelle Collection<Long>
      Angegeben von:
      addAll in Schnittstelle List<Long>
      Setzt außer Kraft:
      addAll in Klasse AbstractLongCollection
    • indexOf

      @Deprecated public int indexOf(Object o)
      Veraltet.
      The IndexOf implementation iterates over all elements and compares them to the search value.
      Angegeben von:
      indexOf in Schnittstelle List<Long>
      Angegeben von:
      indexOf in Schnittstelle LongList
      Parameter:
      o - the value that the index is searched for.
      Gibt zurück:
      index of the value that was searched for. -1 if not found
      Note:
      it is highly suggested not to use this with Primitives because of boxing. But it is still supported because of ObjectComparason that are custom objects and allow to find the contents.
    • lastIndexOf

      @Deprecated public int lastIndexOf(Object o)
      Veraltet.
      The lastIndexOf implementation iterates over all elements and compares them to the search value.
      Angegeben von:
      lastIndexOf in Schnittstelle List<Long>
      Angegeben von:
      lastIndexOf in Schnittstelle LongList
      Parameter:
      o - the value that the index is searched for.
      Gibt zurück:
      the last index of the value that was searched for. -1 if not found
      Note:
      it is highly suggested not to use this with Primitives because of boxing. But it is still supported because of ObjectComparason that are custom objects and allow to find the contents.
    • indexOf

      public int indexOf(long e)
      The indexOf implementation iterates over all elements and compares them to the search value.
      Angegeben von:
      indexOf in Schnittstelle LongList
      Parameter:
      e - the value that the index is searched for.
      Gibt zurück:
      index of the value that was searched for. -1 if not found
    • lastIndexOf

      public int lastIndexOf(long e)
      The lastIndexOf implementation iterates over all elements and compares them to the search value.
      Angegeben von:
      lastIndexOf in Schnittstelle LongList
      Parameter:
      e - the value that the index is searched for.
      Gibt zurück:
      the last index of the value that was searched for. -1 if not found
    • swapRemoveLong

      public boolean swapRemoveLong(long e)
      Beschreibung aus Schnittstelle kopiert: LongList
      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.
      Angegeben von:
      swapRemoveLong in Schnittstelle LongList
      Parameter:
      e - the element that should be removed
      Gibt zurück:
      true if the element was removed
    • equals

      public boolean equals(Object o)
      Compares if the list are the same.
      Angegeben von:
      equals in Schnittstelle Collection<Long>
      Angegeben von:
      equals in Schnittstelle List<Long>
      Setzt außer Kraft:
      equals in Klasse Object
    • hashCode

      public int hashCode()
      Generates the hashcode based on the values stored in the list.
      Angegeben von:
      hashCode in Schnittstelle Collection<Long>
      Angegeben von:
      hashCode in Schnittstelle List<Long>
      Setzt außer Kraft:
      hashCode in Klasse Object
    • subList

      public LongList subList(int fromIndex, int toIndex)
      Beschreibung aus Schnittstelle kopiert: LongList
      A Type-Specific List of subList
      Angegeben von:
      subList in Schnittstelle List<Long>
      Angegeben von:
      subList in Schnittstelle LongList
      Siehe auch:
    • reversed

      public LongList reversed()
      Beschreibung aus Schnittstelle kopiert: LongList
      A Type-Specific List Helper that shows all elements in reverse.
      Angegeben von:
      reversed in Schnittstelle LongList
      Gibt zurück:
      a list wrapper that has all elements reversed!
    • iterator

      public LongIterator iterator()
      Beschreibung aus Schnittstelle kopiert: LongCollection
      Returns a Type-Specific Iterator to reduce (un)boxing
      Angegeben von:
      iterator in Schnittstelle Collection<Long>
      Angegeben von:
      iterator in Schnittstelle Iterable<Long>
      Angegeben von:
      iterator in Schnittstelle List<Long>
      Angegeben von:
      iterator in Schnittstelle LongCollection
      Angegeben von:
      iterator in Schnittstelle LongIterable
      Angegeben von:
      iterator in Klasse AbstractLongCollection
      Gibt zurück:
      a iterator of the collection
      Siehe auch:
    • listIterator

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

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

      public LongListIterator indexedIterator(int... indecies)
      Beschreibung aus Schnittstelle kopiert: LongList
      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
      Angegeben von:
      indexedIterator in Schnittstelle LongList
      Parameter:
      indecies - that should be used for the iteration.
      Gibt zurück:
      a custom indexed iterator
    • indexedIterator

      public LongListIterator indexedIterator(IntList indecies)
      Beschreibung aus Schnittstelle kopiert: LongList
      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
      Angegeben von:
      indexedIterator in Schnittstelle LongList
      Parameter:
      indecies - that should be used for the iteration.
      Gibt zurück:
      a custom indexed iterator
    • size

      public void size(int size)
      Beschreibung aus Schnittstelle kopiert: LongList
      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
      Angegeben von:
      size in Schnittstelle LongList
      Parameter:
      size - the requested amount of elements/room for elements
    • copy

      public AbstractLongList 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
      Angegeben von:
      copy in Schnittstelle LongList
      Setzt außer Kraft:
      copy in Klasse AbstractLongCollection
      Gibt zurück:
      a Shallow Copy of the collection