Interface ILinkedList<E>
- Type Parameters:
E- is the type of the elements of aILinkedList.
- All Superinterfaces:
AggregationRequestable<E>, ArrayMappable<E>, Clearable, Copyable<ILinkedList<E>>, CountRequestable<E>, EmptinessRequestable, Filterable<E>, Groupable<E>, IContainer<E>, IFilteringContainerViewProvider<E>, IIntervallContainerViewProvider<E>, IMappingContainerViewProvider<E>, IndexRequestable<E>, Iterable<E>, IterableWithCopyableIterator<E>, Mappable<E>, MaterializationRequestable, SingleSearchable<E>, StoringRequestable<E>, StringMappable
- All Known Implementing Classes:
LinkedList
A
ILinkedList is a IContainer 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(E element, E... elements) Adds the given element and the given elements at the begin of the currentILinkedList.voidaddAtBegin(Iterable<? extends E> elements) Adds the given elements at the begin of the currentILinkedList.voidAdds the given element at the end of the currentILinkedList.voidAdds the given elements at the end of the currentILinkedList.voidAdds the given element and the given elements at the end of the currentILinkedList.voidAdds the given elements at the end 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 currentILinkedList.voidremoveFirst(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 ArrayMappable
toArray, toByteArray, toCharArray, toDoubleArray, toIntArray, toLongArray, toStringArrayMethods inherited from interface CountRequestable
getCount, getCount, getCountOfMethods inherited from interface EmptinessRequestable
containsAny, isEmptyMethods inherited from interface Filterable
getStoredOfType, getStoredOthers, getStoredSelectedMethods inherited from interface Groupable
getStoredInGroupsMethods inherited from interface IContainer
toOrderedList, toReversedListMethods inherited from interface IFilteringContainerViewProvider
getViewOfStoredSelectedMethods inherited from interface IIntervallContainerViewProvider
getViewFromOneBasedStartIndex, getViewFromOneBasedStartIndexToOneBasedEndIndex, getViewToOneBasedEndIndex, getViewWithoutFirst, getViewWithoutFirst, getViewWithoutLast, getViewWithoutLastMethods inherited from interface IMappingContainerViewProvider
getViewOfMethods inherited from interface IndexRequestable
getOneBasedIndexOfFirst, getOneBasedIndexOfFirstEqualElement, getOneBasedIndexOfFirstOccurrenceOfMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface IterableWithCopyableIterator
iteratorMethods inherited from interface Mappable
to, toMultiples, toNumbers, toStrings, toWithOneBasedIndexMethods inherited from interface MaterializationRequestable
isMaterialized, isViewMethods inherited from interface SingleSearchable
getOptionalStoredFirst, getOptionalStoredFirst, getStoredAtOneBasedIndex, getStoredByMax, getStoredByMin, getStoredFirst, getStoredFirst, getStoredFirstOfType, getStoredLast, getStoredOne, getStoredOneMethods inherited from interface StoringRequestable
contains, containsAllOf, containsAllOf, containsAny, containsAnyOf, containsAnyOf, containsAsManyAs, containsEqualing, containsExactlyEqualingInSameOrder, containsExactlyInSameOrder, containsLessThan, containsMoreThan, containsNone, containsNoneOf, containsNoneOf, containsOnce, containsOne, containsOne, containsOneEqualing, containsOnlyMethods inherited from interface StringMappable
toConcatenatedString, toStringWithSeparator, toStringWithSeparator
-
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 element and the given elements at the begin of the currentILinkedList. The elements will be added in the given order.- Parameters:
element-elements-- Throws:
RuntimeException- if the given element is null.RuntimeException- 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.
-
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.
-
addAtEnd
Adds the given element at the end of the currentILinkedList.- Parameters:
element-- Throws:
RuntimeException- if the given elements is null.
-
addAtEnd
Adds the given element and the given elements at the end of the currentILinkedList. The elements will be added in the given order.- Parameters:
element-elements-- Throws:
RuntimeException- if the given element is null.RuntimeException- if one of the given elements is null.
-
addAtEnd
Adds the given elements at the end of the currentILinkedList. The elements will be added in the given order.- Parameters:
elements-- Throws:
RuntimeException- if one of the given elements is null.
-
addAtEnd
Adds the given elements at the end 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.
-