Interface Mappable<E>
- Type Parameters:
E- the type of the elements aMappable.
- All Known Subinterfaces:
ExtendedIterable<E>, IArrayList<E>, ILinkedList<E>, IMatrix<E>, IMatrixColumn<E>, IMatrixRow<E>, ISqlRecord
- All Known Implementing Classes:
AbstractExtendedIterable, ArrayExtendedIterableView, ArrayList, ExtendedIterableFilterView, ExtendedIterableIntervalView, ExtendedIterableMapperView, ExtendedIterableView, ImmutableList, IterableExtendedIterableView, LinkedList, Matrix, MatrixColumn, MatrixRow, MultiExtendedIterableView, SqlRecord
public interface Mappable<E>
- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescription<T> ExtendedIterable<T> <T> ExtendedIterable<T> toMultiples(Function<E, ExtendedIterable<T>> multipleMapper) <N extends Number>
ExtendedIterable<N> <T> ExtendedIterable<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
ExtendedIterablewith the elements the given mapper maps from the elements of the currentMappable. - Throws:
RuntimeException- if the given mapper is nullRuntimeException- if one of the elements of the currentMappableis null.
-
toMultiples
- Type Parameters:
T- is the type of the elements of theExtendedIterables the given multipleMapper maps from the elements of the currentMappable.- Parameters:
multipleMapper-- Returns:
- a new
ExtendedIterablewith the elements of theExtendedIterables the given multipleMapper maps from the elements of the currentMappable. - Throws:
RuntimeException- if the given multipleMapper is nullRuntimeException- 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
ExtendedIterablewith 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
ExtendedIterable<String> toStrings()- Returns:
- a new
ExtendedIterablewith theStringrepresentations of the elements of the currentExtendedIterable.
-
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
ExtendedIterablewith 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 nullRuntimeException- if one of the elements of the currentMappableis null.
-