Interface Mappable<E>
- Type Parameters:
E- is the type of the elements aMappable.
- All Known Subinterfaces:
IArrayList<E>, IContainer<E>, ILinkedList<E>, IMatrix<E>, IMatrixColumn<E>, IMatrixRow<E>, ISqlRecord
- All Known Implementing Classes:
AbstractContainer, AbstractExtendedContainer, ArrayContainerView, ArrayList, ContainerView, FilterContainerView, ImmutableList, IntervallContainerView, IterableContainerView, LinkedList, MappingContainerView, Matrix, MatrixColumn, MatrixRow, MultiContainerView, SingleContainer, SqlRecord
public interface Mappable<E>
- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescription<T> IContainer<T> <T> IContainer<T> toMultiples(Function<E, IContainer<T>> multipleMapper) <N extends Number>
IContainer<N> <T> IContainer<T> toWithOneBasedIndex(BiFunction<Integer, E, T> mapper)
-
Method Details
-
to
- Type Parameters:
T- is the type of the elements the given mapper maps from the elements of the currentMappable.- Parameters:
mapper-- Returns:
- a new
IContainerwith the elements the given mapper maps from the elements of the currentMappable. - Throws:
RuntimeException- if the given mapper is null.RuntimeException- if one of the elements of the currentMappableis null.
-
toMultiples
- Type Parameters:
T- is the type of the elements of theIContainers the given multipleMapper maps from the elements of the currentMappable.- Parameters:
multipleMapper-- Returns:
- a new
IContainerwith the elements of theIContainers the given multipleMapper maps from the elements of the currentMappable. - Throws:
RuntimeException- if the given multipleMapper is null.RuntimeException- if one of the elements of the currentMappableis null.
-
toNumbers
- Type Parameters:
N- is the type of theNumbers the given numberMapper maps from the elements of the currentMappable.- Parameters:
numberMapper-- Returns:
- a new
IContainerwith theNumbers the given numberMapper maps from the elements of the currentMappable. Maps null elements to 0.0. - Throws:
RuntimeException- if the given numberMapper is null.
-
toStrings
IContainer<String> toStrings()- Returns:
- a new
IContainerwith theStringrepresentations of the elements of the currentIContainer.
-
toWithOneBasedIndex
- Type Parameters:
T- is the type of the elements the given mapper maps from the elements of the currentMappableand from the one-based index of these elements.- Parameters:
mapper-- Returns:
- a new
IContainerwith the elements the given mapper maps from the elements of the currentMappableand from the one-based index of these elements. - Throws:
RuntimeException- if the given mapper is null.RuntimeException- if one of the elements of the currentMappableis null.
-