Interface ILinkedList<E>
- Type Parameters:
E- the type of the elements of aILinkedList.
- All Superinterfaces:
AggregationRequestable<E>, BaseCountRequestable, Clearable, Copyable<ILinkedList<E>>, CountRequestable<E>, EmptinessRequestable, ExtendedIterable<E>, IAppendableList<E>, Iterable<E>, IterableArrayProvider<E>, IterableByExtremumProvider<E>, IterableByIndexProvider<E>, IterableContainAnyRequestable, IterableContainEqualRequestable<E>, IterableContainMatchingRequestable<E>, IterableContainMultipleRequestable, IterableContainObjectRequestable, IterableFilterProvider<E>, IterableFilterViewProvider<E>, IterableFirstProvider<E>, IterableGroupProvider<E>, IterableIntervalViewProvider<E>, IterableLastProvider<E>, IterableMappedProvider<E>, IterableMappedViewProvider<E>, IterableOneBasedIndexRequestable<E>, IterableOrderProvider<E>, IterableStringProvider, IterableWithCopyableIterator<E>, MaterializationRequestable, SingleProvider<E>
- All Known Implementing Classes:
LinkedList
A
ILinkedList is a ExtendedIterable that can add and remove
elements.- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAtBegin(E element) Adds the given element at the begin of the currentILinkedList.voidaddAtBegin(E... elements) Adds the given elements at the begin of the currentILinkedList.voidaddAtBegin(Iterable<? extends E> elements) Adds the given elements at the begin of the currentILinkedList.voidRemoves all elements from the currentILinkedListthe given selector selects.voidremoveAllOccurrencesOf(Object element) Removes all occurrences of the given element from the currentILinkedList.Removes and returns the first element of the currentILinkedList.removeAndGetStoredFirst(Predicate<E> selector) Removes and returns the first element the given selector selects from the currentILinkedList.Removes and returns the last element of the currentILinkedList.voidRemoves the first element from the currentILinkedListvoidremoveFirst(Predicate<E> selector) Removes the first element the given selector selects from the currentILinkedListvoidremoveFirstOccurrenceOf(Object element) Removes the first occurrence of the given element from the currentILinkedList.voidRemoves the first element from the currentILinkedList.voidRemoves the last element from the currentILinkedList.voidRemoves the last element from the currentILinkedList.voidremoveStrictlyFirstOccurrenceOf(Object element) Removes the first occurrence of the given element from the currentILinkedList.voidreplaceFirst(Predicate<E> selector, E element) Replaces the first element the given selector selects from the currentILinkedListwith the given element.Methods inherited from interface AggregationRequestable
getAverage, getAverageOrZero, getMax, getMaxOrZero, getMedian, getMedianOrZero, getMin, getMinOrZero, getStandardDeviation, getSum, getSumOfInts, getVarianceMethods inherited from interface BaseCountRequestable
getCountMethods inherited from interface CountRequestable
getCount, getCountOfMethods inherited from interface IAppendableList
addAtEnd, addAtEnd, addAtEndMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface IterableArrayProvider
toArray, toByteArray, toCharArray, toDoubleArray, toIntArray, toLongArray, toStringArrayMethods inherited from interface IterableByExtremumProvider
getStoredByMax, getStoredByMinMethods inherited from interface IterableByIndexProvider
getStoredAtOneBasedIndexMethods inherited from interface IterableContainAnyRequestable
containsAny, containsNonNull, containsOne, containsOneNoneNull, isEmptyMethods inherited from interface IterableContainEqualRequestable
containsEqual, containsNoEqual, containsOneEqualMethods inherited from interface IterableContainMatchingRequestable
containsMatching, containsMatchingOnly, containsNoMatching, containsOneMatchingMethods inherited from interface IterableContainMultipleRequestable
containsAll, containsAll, containsAny, containsAny, containsExactlyAllEqualInSameOrder, containsExactlyInSameOrder, containsNone, containsNoneMethods inherited from interface IterableContainObjectRequestable
contains, containsOnce, containsOnlyMethods inherited from interface IterableFilterProvider
getStoredOfType, getStoredOthers, getStoredSelectedMethods inherited from interface IterableFilterViewProvider
getViewOfStoredSelectedMethods inherited from interface IterableFirstProvider
getOptionalStoredFirst, getOptionalStoredFirst, getStoredFirst, getStoredFirst, getStoredFirstNonNull, getStoredFirstOfTypeMethods inherited from interface IterableGroupProvider
getStoredInGroupsMethods inherited from interface IterableIntervalViewProvider
getViewFromOneBasedStartIndex, getViewFromOneBasedStartIndexToOneBasedEndIndex, getViewToOneBasedEndIndex, getViewWithoutFirst, getViewWithoutFirst, getViewWithoutLast, getViewWithoutLastMethods inherited from interface IterableLastProvider
getStoredLastMethods inherited from interface IterableMappedProvider
to, toMultiples, toNumbers, toStrings, toWithOneBasedIndexMethods inherited from interface IterableMappedViewProvider
getViewOfMethods inherited from interface IterableOneBasedIndexRequestable
getOneBasedIndexOfFirst, getOneBasedIndexOfFirstEqualElement, getOneBasedIndexOfFirstOccurrenceOfMethods inherited from interface IterableOrderProvider
toOrdered, toReversedMethods inherited from interface IterableStringProvider
toConcatenatedString, toStringWithDelimiter, toStringWithDelimiterMethods inherited from interface IterableWithCopyableIterator
iteratorMethods inherited from interface MaterializationRequestable
isMaterialized, isViewMethods inherited from interface SingleProvider
getStoredSingle, getStoredSingle
-
Method Details
-
addAtBegin
Adds the given element at the begin of the currentILinkedList.- Parameters:
element-- Throws:
RuntimeException- if the given elements is null
-
addAtBegin
Adds the given elements at the begin of the currentILinkedList. The elements will be added in the given order.- Parameters:
elements-- Throws:
RuntimeException- if the given elements is nullRuntimeException- if one of the given elements is null
-
addAtBegin
Adds the given elements at the begin of the currentILinkedList. The elements will be added in the given order.- Parameters:
elements-- Throws:
RuntimeException- if one of the given elements is null
-
removeAll
Removes all elements from the currentILinkedListthe given selector selects.- Parameters:
selector-
-
removeAllOccurrencesOf
Removes all occurrences of the given element from the currentILinkedList.- Parameters:
element-
-
removeAndGetStoredFirst
E removeAndGetStoredFirst()Removes and returns the first element of the currentILinkedList.- Returns:
- the first element of the current
ILinkedList - Throws:
RuntimeException- if the currentILinkedListis empty
-
removeAndGetStoredFirst
Removes and returns the first element the given selector selects from the currentILinkedList.- Parameters:
selector-- Returns:
- the first element the given selector selects from the current
ILinkedList - Throws:
RuntimeException- if the currentILinkedListdoes not contain an element the given selector selects
-
removeAndGetStoredLast
E removeAndGetStoredLast()Removes and returns the last element of the currentILinkedList.- Returns:
- the last element of the current
ILinkedList - Throws:
RuntimeException- if the currentILinkedListis empty
-
removeFirst
void removeFirst()Removes the first element from the currentILinkedList -
removeFirstStrictly
void removeFirstStrictly()Removes the first element from the currentILinkedList.- Throws:
RuntimeException- if the currentILinkedListis empty
-
removeFirst
Removes the first element the given selector selects from the currentILinkedList- Parameters:
selector-
-
removeFirstOccurrenceOf
Removes the first occurrence of the given element from the currentILinkedList.- Parameters:
element-
-
removeLast
void removeLast()Removes the last element from the currentILinkedList. -
removeLastStrictly
void removeLastStrictly()Removes the last element from the currentILinkedList.- Throws:
RuntimeException- if the currentILinkedListis empty
-
removeStrictlyFirstOccurrenceOf
Removes the first occurrence of the given element from the currentILinkedList.- Parameters:
element-- Throws:
RuntimeException- if the currentILinkedListdoes not contain the given element.
-
replaceFirst
Replaces the first element the given selector selects from the currentILinkedListwith the given element.- Parameters:
selector-element-- Throws:
RuntimeException- if the given element is null
-