Klasse ArrayList<E>
java.lang.Object
ch.nolix.core.container.base.Container<E>
ch.nolix.core.container.arraylist.ArrayList<E>
- Typparameter:
E
- is the type of the elements of aArrayList
.
- Alle implementierten Schnittstellen:
IContainer<E>
,IMappableContainer<E>
,ISearchableContainer<E>
,IStatisticalConainer<E>
,IterableWithCopyableIterator<E>
,StoringRequestable<E>
,IArrayList<E>
,Copyable<IArrayList<E>>
,Clearable
,EmptinessRequestable
,MaterializationRequestable
,Iterable<E>
- Version:
- 2024-01-30
- Autor:
- Silvan Wyss
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
The complexity of this implementation is O(n+m) when the currentArrayList
contains n elements and m elements are given.void
The complexity of this implementation is O(n+m) when the currentArrayList
contains n elements and m elements are given.void
clear()
The complexity of this implementation is O(1).protected <E2> ILinkedList
<E2> createEmptyMutableList
(Marker<E2> marker) The complexity of this implementation is O(1).getCopy()
The complexity of this implementation is O(n) when the currentArrayList
contains n elements.int
getCount()
The complexity of this implementation is O(1).getStoredAt1BasedIndex
(int param1BasedIndex) The complexity of this implementation is O(1).The complexity of this implementation is O(1).boolean
The complexity of this implementation is O(1).iterator()
The complexity of this implementation is O(1).<C extends Comparable<C>>
IContainer<E> toOrderedList
(Function<E, C> norm) This implementation uses the merge sort algorithm.toString()
The complexity of this implementation is O(n) if the currentArrayList
contains n elements.static <E2> ArrayList
<E2> withElement
(E2 element, E2... elements) static <E2> ArrayList
<E2> withElements
(E2[] elements) The complexity of this implementation is O(n) when n elements are given.static <E2> ArrayList
<E2> withInitialCapacity
(int initialCapacity) The complexity of this implementation is O(1).Von Klasse geerbte Methoden ch.nolix.core.container.base.Container
contains, containsAll, containsAll, containsAny, containsAny, containsAny, containsAnyOf, containsAsManyAs, containsEqualing, containsExactlyInSameOrder, containsLessThan, containsMoreThan, containsNone, containsNone, containsNoneOf, containsOnce, containsOne, containsOne, containsOneEqualing, containsOnly, containsOnlyEqualingAndViceVersa, from1BasedStartIndex, from1BasedStartIndexUntil1BasedEndIndex, get1BasedIndexOfFirst, get1BasedIndexOfFirstEqualElement, get1BasedIndexOfFirstOccuranceOf, getAverage, getAverageOrZero, getCount, getCount, getMax, getMaxOrZero, getMedian, getMedianOrZero, getMin, getMinOrZero, getOptionalStoredFirst, getOptionalStoredFirst, getStandardDeviation, getStoredAny, getStoredByMax, getStoredByMin, getStoredFirst, getStoredFirst, getStoredGroups, getStoredOfType, getStoredOne, getStoredOne, getStoredOther, getStoredSelected, getSum, getSumOfIntegers, getVariance, isEmpty, to, toArray, toByteArray, toCharArray, toConcatenatedString, toDoubleArray, toFromGroups, toIntArray, toLongArray, toReversedList, toStringArray, toStrings, toStringWithSeparator, toStringWithSeparator, until1BasedIndex, withoutFirst, withoutFirst, withoutLast, withoutLast
Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.stateapi.staterequestapi.EmptinessRequestable
containsAny, isEmpty
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.containerapi.baseapi.IContainer
from1BasedStartIndex, from1BasedStartIndexUntil1BasedEndIndex, get1BasedIndexOfFirst, get1BasedIndexOfFirstEqualElement, get1BasedIndexOfFirstOccuranceOf, toReversedList, toStringArray, toStrings, toStringWithSeparator, toStringWithSeparator, until1BasedIndex, withoutFirst, withoutFirst, withoutLast, withoutLast
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.containerapi.baseapi.IMappableContainer
to, toArray, toByteArray, toCharArray, toConcatenatedString, toDoubleArray, toFromGroups, toIntArray, toLongArray
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.containerapi.baseapi.ISearchableContainer
getOptionalStoredFirst, getOptionalStoredFirst, getStoredAny, getStoredByMax, getStoredByMin, getStoredFirst, getStoredFirst, getStoredGroups, getStoredOfType, getStoredOne, getStoredOne, getStoredOther, getStoredSelected
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.containerapi.baseapi.IStatisticalConainer
getAverage, getAverageOrZero, getCount, getCount, getMax, getMaxOrZero, getMedian, getMedianOrZero, getMin, getMinOrZero, getStandardDeviation, getSum, getSumOfIntegers, getVariance
Von Schnittstelle geerbte Methoden java.lang.Iterable
forEach, spliterator
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.stateapi.staterequestapi.MaterializationRequestable
isView
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.containerapi.baseapi.StoringRequestable
contains, containsAll, containsAll, containsAny, containsAny, containsAnyOf, containsAsManyAs, containsEqualing, containsExactlyInSameOrder, containsLessThan, containsMoreThan, containsNone, containsNone, containsNoneOf, containsOnce, containsOne, containsOne, containsOneEqualing, containsOnly, containsOnlyEqualingAndViceVersa
-
Konstruktordetails
-
ArrayList
public ArrayList()
-
-
Methodendetails
-
withElement
- 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
The 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
The complexity of this implementation is O(1).- Typparameter:
E2
- is the type of the elements of the createdArrayList
.- Parameter:
initialCapacity
-- Gibt zurück:
- a new
ArrayList
with the given initialCapacity - Löst aus:
NegativeArgumentException
- if the given initialCapacity is negative.
-
addAtEnd
The complexity of this implementation is O(n+m) when the currentArrayList
contains n elements and m elements are given. Adds the given given elements at the end of the currentIArrayList
. The elements will be added in the given order.- Angegeben von:
addAtEnd
in SchnittstelleIArrayList<E>
- Parameter:
element
-elements
-
-
addAtEnd
The complexity of this implementation is O(n+m) when the currentArrayList
contains n elements and m elements are given. Adds the given elements at the end of the currentIArrayList
. The elements will be added in the given order.- Angegeben von:
addAtEnd
in SchnittstelleIArrayList<E>
- Parameter:
elements
-
-
clear
public void clear()The complexity of this implementation is O(1). Removes the elements of the currentClearable
. -
getCopy
The complexity of this implementation is O(n) when the currentArrayList
contains n elements. -
getCount
public int getCount()The complexity of this implementation is O(1).- Angegeben von:
getCount
in SchnittstelleIStatisticalConainer<E>
- Gibt zurück:
- the number of elements of the current
IStatisticalConainer
.
-
getStoredAt1BasedIndex
The complexity of this implementation is O(1).- Angegeben von:
getStoredAt1BasedIndex
in SchnittstelleISearchableContainer<E>
- Parameter:
param1BasedIndex
-- Gibt zurück:
- the element at the given p1BasedIndex.
-
getStoredLast
The complexity of this implementation is O(1).- Angegeben von:
getStoredLast
in SchnittstelleISearchableContainer<E>
- Gibt zurück:
- the last element of the current
ISearchableContainer
.
-
isMaterialized
public boolean isMaterialized()The complexity of this implementation is O(1).- Angegeben von:
isMaterialized
in SchnittstelleMaterializationRequestable
- Gibt zurück:
- true if the current
MaterializationRequestable
is materialized, false otherwise.
-
iterator
The complexity of this implementation is O(1). -
toOrderedList
This implementation uses the merge sort algorithm. The complexity of this implementation is O(n*log(n)) if the currentArrayList
contains n elements.- Angegeben von:
toOrderedList
in SchnittstelleIContainer<E>
- Typparameter:
C
- is the type of theComparable
s the given norm returns.- Parameter:
norm
-- Gibt zurück:
- a new
IContainer
with the elements of the currentIContainer
ordered from the smallest to the biggest element according to the given norm.
-
toString
The complexity of this implementation is O(n) if the currentArrayList
contains n elements. -
createEmptyMutableList
The complexity of this implementation is O(1).- Angegeben von:
createEmptyMutableList
in KlasseContainer<E>
- Typparameter:
E2
- is the type of the elements the createdILinkedList
can contain.- Parameter:
marker
-- Gibt zurück:
- a new empty
ILinkedList
.
-