Schnittstelle ISearchableContainer<E>
- Typparameter:
E
- is the type of the elements aISearchableContainer
.
- Alle bekannten Unterschnittstellen:
IArrayList<E>
,ICachingContainer<E>
,IContainer<E>
,ILinkedList<E>
,IMatrix<E>
- Alle bekannten Implementierungsklassen:
ArrayList
,ArrayReadContainer
,CachingContainer
,CompressedList
,Container
,GapMatrix
,ImmutableList
,IterableReadContainer
,LinkedList
,Matrix
,MatrixColumn
,MatrixRow
,MultiReadContainer
,ReadContainer
public interface ISearchableContainer<E>
- Version:
- 2023-10-14
- Autor:
- Silvan Wyss
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibunggetOptionalStoredFirst
(Predicate<? super E> selector) getStoredAt1BasedIndex
(int p1BasedIndex) <C extends Comparable<C>>
EgetStoredByMax
(Function<E, C> norm) <C extends Comparable<C>>
EgetStoredByMin
(Function<E, C> norm) getStoredFirst
(Predicate<? super E> selector) IContainer
<? extends IContainer<E>> getStoredGroups
(Function<E, ?> norm) <E2 extends E>
IContainer<E2> getStoredOfType
(Class<E2> type) getStoredOne
(Predicate<? super E> selector) getStoredOther
(Predicate<E> selector) getStoredSelected
(Predicate<? super E> selector)
-
Methodendetails
-
getOptionalStoredFirst
- Gibt zurück:
- a
Optional
with the first element of the currentISearchableContainer
if the currentISearchableContainer
contains any, an emptyOptional
otherwise.
-
getOptionalStoredFirst
- Parameter:
selector
-- Gibt zurück:
- a new
Optional
with the first element the given selector selects from the currentISearchableContainer
if the currentISearchableContainer
contains an element the given selector selects, an emptyOptional
otherwise. - Löst aus:
RuntimeException
- if the given selector is null.
-
getStoredAny
E getStoredAny()- Gibt zurück:
- a randomly selected element of the current
ISearchableContainer
. - Löst aus:
RuntimeException
- if the currentISearchableContainer
is empty.
-
getStoredAt1BasedIndex
- Parameter:
p1BasedIndex
-- Gibt zurück:
- the element at the given p1BasedIndex.
- Löst aus:
RuntimeException
- if the currentISearchableContainer
does not contain an element at the given p1BasedIndex.
-
getStoredByMax
- Typparameter:
C
- is the type of theComparable
s the given norm returns.- Parameter:
norm
-- Gibt zurück:
- the element with the biggest
Comparable
the given norm returns from the elements of the currentISearchableContainer
. - Löst aus:
RuntimeException
- if the currentISearchableContainer
is empty.
-
getStoredByMin
- Typparameter:
C
- is the type of theComparable
s the given norm returns.- Parameter:
norm
-- Gibt zurück:
- the element with the smallest
Comparable
the given norm returns from the elements of the currentISearchableContainer
. - Löst aus:
RuntimeException
- if the currentISearchableContainer
is empty.
-
getStoredFirst
E getStoredFirst()- Gibt zurück:
- the first element of the current
ISearchableContainer
. - Löst aus:
RuntimeException
- if the currentISearchableContainer
is empty.
-
getStoredFirst
- Parameter:
selector
-- Gibt zurück:
- the first element the given selector selects from the current
ISearchableContainer
. - Löst aus:
RuntimeException
- if the currentISearchableContainer
does not contain an element the given selector selects.
-
getStoredGroups
- Parameter:
norm
-- Gibt zurück:
- a new
ISearchableContainer
with groups with the elements of the currentISearchableContainer
grouped by the given norm.
-
getStoredLast
E getStoredLast()- Gibt zurück:
- the last element of the current
ISearchableContainer
. - Löst aus:
RuntimeException
- if the currentISearchableContainer
is empty.
-
getStoredOfType
- Typparameter:
E2
- is the type of the elements of the returnedISearchableContainer
.- Parameter:
type
-- Gibt zurück:
- a new
ISearchableContainer
with the elements from the currentISearchableContainer
that are of the given type.
-
getStoredOne
E getStoredOne()- Gibt zurück:
- the one element of the current
ISearchableContainer
. - Löst aus:
RuntimeException
- if the currentISearchableContainer
is empty.RuntimeException
- if the currentISearchableContainer
contains several elements.
-
getStoredOne
- Parameter:
selector
-- Gibt zurück:
- the one element the given selector selects from the current
ISearchableContainer
. - Löst aus:
RuntimeException
- if the given selector selects none or several elements from the currentISearchableContainer
.
-
getStoredOther
- Parameter:
selector
-- Gibt zurück:
- a new
ISearchableContainer
with the elements from the currentISearchableContainer
the given selector skips (!).
-
getStoredSelected
- Parameter:
selector
-- Gibt zurück:
- a new
ISearchableContainer
with the elements the given selector selects from the currentISearchableContainer
.
-