Klasse ArrayList<E>

Typparameter:
E - is the type of the elements of a ArrayList.
Alle implementierten Schnittstellen:
Filterable<E>, Groupable<E>, IContainer<E>, IFilteringContainerViewProvider<E>, IIntervallContainerViewProvider<E>, IMappingContainerViewProvider<E>, Mappable<E>, AggregationRequestable<E>, ArrayMappable<E>, CountRequestable<E>, IndexRequestable<E>, IterableWithCopyableIterator<E>, SingleSearchable<E>, StoringRequestable<E>, StringMappable, IArrayList<E>, Clearable, EmptinessRequestable, MaterializationRequestable, Copyable<IArrayList<E>>, Iterable<E>

public final class ArrayList<E> extends AbstractExtendedContainer<E> implements IArrayList<E>
Version:
2024-01-30
Autor:
Silvan Wyss
  • Methodendetails

    • createEmpty

      public static <E2> ArrayList<E2> createEmpty()
      Typparameter:
      E2 - is the type of the elements of the ArrayList.
      Gibt zurück:
      a new empty ArrayList.
    • withElement

      public static <E2> ArrayList<E2> withElement(E2 element, E2... elements)
      Typparameter:
      E2 - is the type of the given element and the given elements.
      Parameter:
      element -
      elements -
      Gibt zurück:
      a new ArrayList with the given element and elements.
      Löst aus:
      ArgumentIsNullException - if the given element is null.
      ArgumentIsNullException - if the given elements is null.
      ArgumentIsNullException - if one of the given elements is null.
    • withElements

      public static <E2> ArrayList<E2> withElements(E2[] elements)
      The time complexity of this implementation is O(n) when n elements are given.
      Typparameter:
      E2 - is the type of the given elements.
      Parameter:
      elements -
      Gibt zurück:
      a new ArrayList with the given elements.
      Löst aus:
      ArgumentIsNullException - if the given elements is null.
      ArgumentIsNullException - if one of the given elements is null.
    • withInitialCapacity

      public static <E2> ArrayList<E2> withInitialCapacity(int initialCapacity)
      The time complexity of this implementation is O(1).
      Typparameter:
      E2 - is the type of the elements of the created ArrayList.
      Parameter:
      initialCapacity -
      Gibt zurück:
      a new ArrayList with the given initialCapacity
      Löst aus:
      NegativeArgumentException - if the given initialCapacity is negative.
    • withInitialCapacityFromSizeOfContainer

      public static <E2> ArrayList<E2> withInitialCapacityFromSizeOfContainer(CountRequestable<?> container)
      The time complexity of this implementation is O(1).
      Typparameter:
      E2 - is the type of the elements of the created ArrayList.
      Parameter:
      container -
      Gibt zurück:
      a new ArrayList with a initialCapacity that is the size of the given container.
      Löst aus:
      NullPointerException - if the given container is null.
    • addAtEnd

      public void addAtEnd(E element)
      The time complexity of this implementation is O(n) when the current ArrayList contains n elements. Adds the given element at the end of the current IArrayList.
      Angegeben von:
      addAtEnd in Schnittstelle IArrayList<E>
      Parameter:
      element -
    • addAtEnd

      public void addAtEnd(E element, E... elements)
      The time complexity of this implementation is O(n+m) when the current ArrayList contains n elements and m elements are given. Adds the given given elements at the end of the current IArrayList. The elements will be added in the given order.
      Angegeben von:
      addAtEnd in Schnittstelle IArrayList<E>
      Parameter:
      element -
      elements -
    • addAtEnd

      public void addAtEnd(E[] elements)
      The time complexity of this implementation is O(n+m) when the current ArrayList contains n elements and m elements are given. Adds the given elements at the end of the current IArrayList. The elements will be added in the given order.
      Angegeben von:
      addAtEnd in Schnittstelle IArrayList<E>
      Parameter:
      elements -
    • addAtEnd

      public void addAtEnd(Iterable<? extends E> elements)
      The time complexity of this implementation is O(n+m) when the current ArrayList contains n elements and m elements are given. Adds the given elements at the end of the current IArrayList. The elements will be added in the given order.
      Angegeben von:
      addAtEnd in Schnittstelle IArrayList<E>
      Parameter:
      elements -
    • clear

      public void clear()
      The time complexity of this implementation is O(1). Removes the elements of the current Clearable.
      Angegeben von:
      clear in Schnittstelle Clearable
    • createCopy

      public IArrayList<E> createCopy()
      The time complexity of this implementation is O(n) when the current ArrayList contains n elements.
      Angegeben von:
      createCopy in Schnittstelle Copyable<E>
      Gibt zurück:
      a new copy of the current Copyable.
    • getCount

      public int getCount()
      The time complexity of this implementation is O(1).
      Angegeben von:
      getCount in Schnittstelle CountRequestable<E>
      Gibt zurück:
      the number of elements of the current CountRequestable.
    • getStoredAtOneBasedIndex

      public E getStoredAtOneBasedIndex(int oneBasedIndex)
      The time complexity of this implementation is O(1).
      Angegeben von:
      getStoredAtOneBasedIndex in Schnittstelle SingleSearchable<E>
      Parameter:
      oneBasedIndex -
      Gibt zurück:
      the element at the given oneBasedIndex. The element can be null.
    • isMaterialized

      public boolean isMaterialized()
      The time complexity of this implementation is O(1).
      Angegeben von:
      isMaterialized in Schnittstelle MaterializationRequestable
      Gibt zurück:
      true if the current MaterializationRequestable is materialized, false otherwise.
    • iterator

      public CopyableIterator<E> iterator()
      The time complexity of this implementation is O(1).
      Angegeben von:
      iterator in Schnittstelle Iterable<E>
      Angegeben von:
      iterator in Schnittstelle IterableWithCopyableIterator<E>
    • toString

      public String toString()
      The time complexity of this implementation is O(n) if the current ArrayList contains n elements.
      Setzt außer Kraft:
      toString in Klasse Object