Interface ArrayMappable<E>
- Type Parameters:
E- is the type of the elements aArrayMappable.
- 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 ArrayMappable<E>
- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptionObject[]toArray()byte[]toByteArray(Function<E, Byte> byteMapper) char[]toCharArray(Function<E, Character> charMapper) double[]toDoubleArray(ToDoubleFunction<E> doubleMapper) int[]toIntArray(ToIntFunction<E> intMapper) long[]toLongArray(ToLongFunction<E> longMapper) String[]
-
Method Details
-
toArray
Object[] toArray()- Returns:
- a new array with the elements of the current
ArrayMappable.
-
toByteArray
- Parameters:
byteMapper-- Returns:
- a new array with the bytes the given byteMapper maps from the
elements of the current
ArrayMappable. Maps null elements to 0. - Throws:
RuntimeException- if the given byteMapper is null.
-
toCharArray
- Parameters:
charMapper-- Returns:
- a new array with the chars the given charMapper maps from the
elements of the current
ArrayMappable. Maps null elements to a space. - Throws:
RuntimeException- if the given charMapper is null.
-
toDoubleArray
- Parameters:
doubleMapper-- Returns:
- a new array with the doubles the given doubleMapper maps from the
elements of the current
ArrayMappable. Maps null elements to 0.0. - Throws:
RuntimeException- if the given doubleMapper is null.
-
toIntArray
- Parameters:
intMapper-- Returns:
- a new array with the ints the given intMapper maps from the elements
of the current
ArrayMappable. Maps null elements to 0. Maps null elements to 0. - Throws:
RuntimeException- if the given intMapper is null.
-
toLongArray
- Parameters:
longMapper-- Returns:
- a new array with the longs the given longMapper maps from the
elements of the current
ArrayMappable. Maps null elements to 0. - Throws:
RuntimeException- if the given longMapper is null.
-
toStringArray
String[] toStringArray()- Returns:
- a new array with the
Stringrepresentations of the elements of the currentArrayMappable.
-