Klasse LinkedList<E>
java.lang.Object
ch.nolix.core.container.base.Container<E>
ch.nolix.core.container.linkedlist.LinkedList<E>
- Typparameter:
E
- is the type of the elements of aLinkedList
.
- Alle implementierten Schnittstellen:
IContainer<E>
,IMappableContainer<E>
,ISearchableContainer<E>
,IStatisticalConainer<E>
,IterableWithCopyableIterator<E>
,StoringRequestable<E>
,ILinkedList<E>
,Copyable<ILinkedList<E>>
,Clearable
,EmptinessRequestable
,MaterializationRequestable
,Iterable<E>
- Version:
- 2016-01-01
- Autor:
- Silvan Wyss
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
addAtBegin
(E element) Adds the given element at the begin of the currentILinkedList
.void
addAtBegin
(E[] elements) The complexity of this implementation is O(n) if n elements are given.void
addAtBegin
(E element, E... elements) Adds the given element and the given elements at the begin of the currentILinkedList
.void
addAtBegin
(Iterable<? extends E> elements) Adds the given elements at the begin of the currentILinkedList
.void
The complexity of this implementation is O(1).void
The complexity of this implementation is O(n) if n elements are given.final void
The complexity of this implementation is O(n) if n elements are given.void
Adds the given elements at the end of the currentLinkedList
.void
clear()
Removes all elements of the currentLinkedList
.protected <E2> ILinkedList
<E2> createEmptyMutableList
(Marker<E2> marker) boolean
An object equals a list if it is a list containing exactly the same elements.static <E2> LinkedList
<E2> fromArray
(E2[] array) static <E2> LinkedList
<E2> fromIterable
(Iterable<E2> container) getCopy()
The complexity of this implementation is O(n) if the currentLinkedList
contains n elements.int
getCount()
The complexity of this implementation is O(1).getStoredAt1BasedIndex
(int p1BasedIndex) The complexity of this implementation is O(n) if the currentContainer
contains n elements.The complexity of this implementation is O(1).int
hashCode()
boolean
iterator()
The complexity of this implementation is O(1).void
The complexity of this implementation is O(n) if the currentLinkedList
contains n elements.void
removeAllOccurrencesOf
(Object element) The complexity of this implementation is O(n) if the currentLinkedList
contains n elements.The complexity of this implementation is O(1).removeAndGetStoredFirst
(Predicate<E> selector) The complexity of this implementation is O(n) if the currentLinkedList
contains n elements.The complexity of this implementation is O(1).void
The complexity of this implementation is O(1).void
removeFirst
(Predicate<E> selector) The complexity of this implementation is O(n) if the currentLinkedList
contains n elements.void
removeFirstOccurrenceOf
(Object element) The complexity of this implementation is O(n) if the currentLinkedList
contains n elements.void
The complexity of this implementation is O(1).void
The complexity of this implementation is O(n).void
The complexity of this implementation is O(n).void
removeStrictlyFirstOccurrenceOf
(Object element) The complexity of this implementation is O(n).void
replaceFirst
(Predicate<E> selector, E element) The complexity of this implementation is O(n) if the currentLinkedList
contains n elements.<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 currentLinkedList
contains n elements.static <E2> LinkedList
<E2> withElement
(E2 element, E2... elements) 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, finalize, getClass, 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
-
LinkedList
public LinkedList()
-
-
Methodendetails
-
fromArray
- Typparameter:
E2
- is the type of the elements of the given array.- Parameter:
array
-- Gibt zurück:
- a new
LinkedList
with the elements in the given array. - Löst aus:
ArgumentIsNullException
- if the given array is null.ArgumentIsNullException
- if one of the elements in the given array is null.
-
fromIterable
- Typparameter:
E2
- is the type of the elements of the given container.- Parameter:
container
-- Gibt zurück:
- a new
LinkedList
with the elements in the given container. - Löst aus:
ArgumentIsNullException
- if the given container is null.ArgumentIsNullException
- if one of the elements in the given container is null.
-
withElement
- Typparameter:
E2
- is the type of the given elements.- Parameter:
element
-elements
-- Gibt zurück:
- a new
LinkedList
with the given elements. - Löst aus:
ArgumentIsNullException
- if the given element or one of the given elements is null.
-
addAtBegin
Adds the given element at the begin of the currentILinkedList
.- Angegeben von:
addAtBegin
in SchnittstelleILinkedList<E>
- Parameter:
element
-
-
addAtBegin
Adds the given element and the given elements at the begin of the currentILinkedList
. The elements will be added in the given order.- Angegeben von:
addAtBegin
in SchnittstelleILinkedList<E>
- Parameter:
element
-elements
-
-
addAtBegin
The complexity of this implementation is O(n) if n elements are given. Adds the given elements at the begin of the currentILinkedList
. The elements will be added in the given order.- Angegeben von:
addAtBegin
in SchnittstelleILinkedList<E>
- Parameter:
elements
-
-
addAtBegin
Adds the given elements at the begin of the currentILinkedList
. The elements will be added in the given order.- Angegeben von:
addAtBegin
in SchnittstelleILinkedList<E>
- Parameter:
elements
-
-
addAtEnd
The complexity of this implementation is O(1). Adds the given element at the end of the currentILinkedList
.- Angegeben von:
addAtEnd
in SchnittstelleILinkedList<E>
- Parameter:
element
-
-
addAtEnd
The complexity of this implementation is O(n) if n elements are given. Adds the given element and the given elements at the end of the currentILinkedList
. The elements will be added in the given order.- Angegeben von:
addAtEnd
in SchnittstelleILinkedList<E>
- Parameter:
element
-elements
-
-
addAtEnd
The complexity of this implementation is O(n) if n elements are given. Adds the given elements at the end of the currentILinkedList
. The elements will be added in the given order.- Angegeben von:
addAtEnd
in SchnittstelleILinkedList<E>
- Parameter:
elements
-
-
addAtEnd
Adds the given elements at the end of the currentLinkedList
. The complexity of this implementation is O(n) if n elements are given.- Angegeben von:
addAtEnd
in SchnittstelleILinkedList<E>
- Parameter:
elements
-- Löst aus:
ArgumentIsNullException
- if one of the given elements is null.
-
clear
public void clear()Removes all elements of the currentLinkedList
. The complexity of this implementation is O(n) when the currentLinkedList
contains n elements. -
equals
An object equals a list if it is a list containing exactly the same elements. -
getCopy
The complexity of this implementation is O(n) if the currentLinkedList
contains n elements. -
getStoredAt1BasedIndex
The complexity of this implementation is O(n) if the currentContainer
contains n elements.- Angegeben von:
getStoredAt1BasedIndex
in SchnittstelleISearchableContainer<E>
- Parameter:
p1BasedIndex
-- Gibt zurück:
- the element at the given index.
- Löst aus:
NonPositiveArgumentException
- if the given index is not positive.ArgumentDoesNotHaveAttributeException
- if the currentContainer
does not contain an element at the given index.
-
getStoredLast
The complexity of this implementation is O(1).- Angegeben von:
getStoredLast
in SchnittstelleISearchableContainer<E>
- Gibt zurück:
- the last element of the current
LinkedList
. - Löst aus:
EmptyArgumentException
- if the currentLinkedList
is empty.
-
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
LinkedList
.
-
hashCode
public int hashCode() -
isMaterialized
public boolean isMaterialized()- 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).- Angegeben von:
iterator
in SchnittstelleIterable<E>
- Angegeben von:
iterator
in SchnittstelleIterableWithCopyableIterator<E>
- Gibt zurück:
- a new iterator of the current
LinkedList
.
-
removeAll
The complexity of this implementation is O(n) if the currentLinkedList
contains n elements. Removes all elements from the currentILinkedList
the given selector selects.- Angegeben von:
removeAll
in SchnittstelleILinkedList<E>
- Parameter:
selector
-
-
removeAllOccurrencesOf
The complexity of this implementation is O(n) if the currentLinkedList
contains n elements. Removes all occurrences of the given element from the currentILinkedList
.- Angegeben von:
removeAllOccurrencesOf
in SchnittstelleILinkedList<E>
- Parameter:
element
-
-
removeAndGetStoredFirst
The complexity of this implementation is O(1). Removes and returns the first element of the currentILinkedList
.- Angegeben von:
removeAndGetStoredFirst
in SchnittstelleILinkedList<E>
- Gibt zurück:
- the first element of the current
ILinkedList
.
-
removeAndGetStoredFirst
The complexity of this implementation is O(n) if the currentLinkedList
contains n elements. Removes and returns the first element the given selector selects from the currentILinkedList
.- Angegeben von:
removeAndGetStoredFirst
in SchnittstelleILinkedList<E>
- Parameter:
selector
-- Gibt zurück:
- the first element the given selector selects from the current
ILinkedList
.
-
removeAndGetStoredLast
The complexity of this implementation is O(1). Removes and returns the last element of the currentILinkedList
.- Angegeben von:
removeAndGetStoredLast
in SchnittstelleILinkedList<E>
- Gibt zurück:
- the last element of the current
ILinkedList
.
-
removeFirst
public void removeFirst()The complexity of this implementation is O(1). Removes the first element from the currentILinkedList
.- Angegeben von:
removeFirst
in SchnittstelleILinkedList<E>
-
removeFirstStrictly
public void removeFirstStrictly()The complexity of this implementation is O(1). Removes the first element from the currentILinkedList
.- Angegeben von:
removeFirstStrictly
in SchnittstelleILinkedList<E>
-
removeFirst
The complexity of this implementation is O(n) if the currentLinkedList
contains n elements. Removes the first element the given selector selects from the currentILinkedList
- Angegeben von:
removeFirst
in SchnittstelleILinkedList<E>
- Parameter:
selector
-
-
removeFirstOccurrenceOf
The complexity of this implementation is O(n) if the currentLinkedList
contains n elements. Removes the first occurrence of the given element from the currentILinkedList
.- Angegeben von:
removeFirstOccurrenceOf
in SchnittstelleILinkedList<E>
- Parameter:
element
-
-
removeLast
public void removeLast()The complexity of this implementation is O(n). Removes the last element from the currentILinkedList
.- Angegeben von:
removeLast
in SchnittstelleILinkedList<E>
-
removeLastStrictly
public void removeLastStrictly()The complexity of this implementation is O(n). Removes the last element from the currentILinkedList
.- Angegeben von:
removeLastStrictly
in SchnittstelleILinkedList<E>
-
removeStrictlyFirstOccurrenceOf
The complexity of this implementation is O(n). Removes the first occurrence of the given element from the currentILinkedList
.- Angegeben von:
removeStrictlyFirstOccurrenceOf
in SchnittstelleILinkedList<E>
- Parameter:
element
-
-
replaceFirst
The complexity of this implementation is O(n) if the currentLinkedList
contains n elements. Replaces the first element the given selector selects from the currentILinkedList
with the given element.- Angegeben von:
replaceFirst
in SchnittstelleILinkedList<E>
- Parameter:
selector
-element
-
-
toOrderedList
This implementation uses the merge sort algorithm. The complexity of this implementation is O(n*log(n)) if the currentContainer
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 currentLinkedList
contains n elements. -
createEmptyMutableList
- 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
.
-