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>
,IViewProviderContainer<E>
,Mappable<E>
,MultiSearchable<E>
,ArrayMappable<E>
,ICountingContainer<E>
,IndexRequestable<E>
,IStatisticalConainer<E>
,IterableWithCopyableIterator<E>
,SingleSearchable<E>
,StoringRequestable<E>
,StringMappable
,IArrayList<E>
,Copyable<IArrayList<E>>
,Clearable
,EmptinessRequestable
,MaterializationRequestable
,Iterable<E>
- Version:
- 2024-01-30
- Autor:
- Silvan Wyss
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
The time complexity of this implementation is O(n+m) when the currentArrayList
contains n elements and m elements are given.void
The time complexity of this implementation is O(n+m) when the currentArrayList
contains n elements and m elements are given.void
clear()
The time complexity of this implementation is O(1).static <E2> ArrayList
<E2> protected <E2> ILinkedList
<E2> createEmptyMutableList
(Marker<E2> marker) The time complexity of this implementation is O(1).getCopy()
The time complexity of this implementation is O(n) when the currentArrayList
contains n elements.int
getCount()
The time complexity of this implementation is O(1).getStoredAt1BasedIndex
(int param1BasedIndex) The time complexity of this implementation is O(1).boolean
The time complexity of this implementation is O(1).iterator()
The time 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 time 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 time complexity of this implementation is O(n) when n elements are given.static <E2> ArrayList
<E2> withInitialCapacity
(int initialCapacity) The time complexity of this implementation is O(1).Von Klasse geerbte Methoden ch.nolix.core.container.base.Container
contains, containsAll, containsAll, containsAll, containsAny, containsAny, containsAnyOf, containsAnyOf, containsAsManyAs, containsEqualing, containsExactlyEqualingInSameOrder, containsExactlyInSameOrder, containsLessThan, containsMoreThan, containsNone, containsNone, containsNoneOf, containsOnce, containsOne, containsOne, containsOneEqualing, containsOnly, get1BasedIndexOfFirst, get1BasedIndexOfFirstEqualElement, get1BasedIndexOfFirstOccurrenceOf, getAverage, getAverageOrZero, getCount, getCountOf, getMax, getMaxOrZero, getMedian, getMedianOrZero, getMin, getMinOrZero, getOptionalStoredFirst, getOptionalStoredFirst, getStandardDeviation, getStoredByMax, getStoredByMin, getStoredFirst, getStoredFirst, getStoredFirstOfType, getStoredInGroups, getStoredLast, getStoredOfType, getStoredOne, getStoredOne, getStoredOthers, getStoredSelected, getSum, getSumOfInts, getVariance, getViewFrom1BasedStartIndex, getViewFrom1BasedStartIndexTo1BasedEndIndex, getViewTo1BasedEndIndex, getViewWithoutFirst, getViewWithoutFirst, getViewWithoutLast, getViewWithoutLast, isEmpty, to, toArray, toByteArray, toCharArray, toConcatenatedString, toDoubleArray, toIntArray, toLongArray, toMultiple, toNumbers, toReversedList, toStringArray, toStrings, toStringWithSeparator, toStringWithSeparator
Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.containerapi.commoncontainerapi.ArrayMappable
toArray, toByteArray, toCharArray, toDoubleArray, toIntArray, toLongArray, toStringArray
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.stateapi.staterequestapi.EmptinessRequestable
containsAny, isEmpty
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.containerapi.baseapi.IContainer
toReversedList
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.containerapi.commoncontainerapi.ICountingContainer
getCount, getCountOf
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.containerapi.commoncontainerapi.IndexRequestable
get1BasedIndexOfFirst, get1BasedIndexOfFirstEqualElement, get1BasedIndexOfFirstOccurrenceOf
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.containerapi.commoncontainerapi.IStatisticalConainer
getAverage, getAverageOrZero, getMax, getMaxOrZero, getMedian, getMedianOrZero, getMin, getMinOrZero, getStandardDeviation, getSum, getSumOfInts, getVariance
Von Schnittstelle geerbte Methoden java.lang.Iterable
forEach, spliterator
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.containerapi.baseapi.IViewProviderContainer
getViewFrom1BasedStartIndex, getViewFrom1BasedStartIndexTo1BasedEndIndex, getViewTo1BasedEndIndex, getViewWithoutFirst, getViewWithoutFirst, getViewWithoutLast, getViewWithoutLast
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.containerapi.baseapi.Mappable
to, toMultiple, toNumbers, toStrings
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.stateapi.staterequestapi.MaterializationRequestable
isView
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.containerapi.baseapi.MultiSearchable
getStoredInGroups, getStoredOfType, getStoredOthers, getStoredSelected
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.containerapi.commoncontainerapi.SingleSearchable
getOptionalStoredFirst, getOptionalStoredFirst, getStoredByMax, getStoredByMin, getStoredFirst, getStoredFirst, getStoredFirstOfType, getStoredLast, getStoredOne, getStoredOne
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.containerapi.commoncontainerapi.StoringRequestable
contains, containsAll, containsAll, containsAll, containsAny, containsAny, containsAnyOf, containsAnyOf, containsAsManyAs, containsEqualing, containsExactlyEqualingInSameOrder, containsExactlyInSameOrder, containsLessThan, containsMoreThan, containsNone, containsNone, containsNoneOf, containsOnce, containsOne, containsOne, containsOneEqualing, containsOnly
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.containerapi.commoncontainerapi.StringMappable
toConcatenatedString, toStringWithSeparator, toStringWithSeparator
-
Methodendetails
-
createEmpty
-
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 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
The time 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 time 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 time 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 time complexity of this implementation is O(1). Removes the elements of the currentClearable
. -
getCopy
The time complexity of this implementation is O(n) when the currentArrayList
contains n elements. -
getCount
public int getCount()The time complexity of this implementation is O(1).- Angegeben von:
getCount
in SchnittstelleICountingContainer<E>
- Gibt zurück:
- the number of elements of the current
ICountingContainer
.
-
getStoredAt1BasedIndex
The time complexity of this implementation is O(1).- Angegeben von:
getStoredAt1BasedIndex
in SchnittstelleSingleSearchable<E>
- Parameter:
param1BasedIndex
-- Gibt zurück:
- the element at the given param1BasedIndex. The element can be null.
-
isMaterialized
public boolean isMaterialized()The time 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 time 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 comparableMapper 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 theComparable
s the given comparableMapper maps from the elements of the currentIContainer
.
-
toString
The time complexity of this implementation is O(n) if the currentArrayList
contains n elements. -
createEmptyMutableList
The time 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
.
-