Package io.jenetics.jpx
Interface Filter<T,R>
-
- Type Parameters:
T
- the value type for the transformed objectsR
- the result type of the filtered object
- All Known Implementing Classes:
Route.Builder
,Track.Builder
,TrackSegment.Builder
public interface Filter<T,R>
Filter interface which contains thefilter
,map
,flatMap
andlistMap
methods for transforming values from typeT
.- Since:
- 1.1
- Version:
- 1.1
- Author:
- Franz Wilhelmstötter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description R
build()
Return a new object of typeR
which contains the elements of the applied filter functions.Filter<T,R>
filter(Predicate<? super T> predicate)
Return a filter consisting of the elements of this filter that matches the given predicate.Filter<T,R>
flatMap(Function<? super T,? extends List<T>> mapper)
Return a filter consisting of the results of replacing each element with the contents of the mapped elements.Filter<T,R>
listMap(Function<? super List<T>,? extends List<T>> mapper)
Return a filter with the results of the applying given mapper function.Filter<T,R>
map(Function<? super T,? extends T> mapper)
Return a filter with the results of applying the given mapper function.
-
-
-
Method Detail
-
filter
Filter<T,R> filter(Predicate<? super T> predicate)
Return a filter consisting of the elements of this filter that matches the given predicate.- Parameters:
predicate
- a non-interfering, stateless predicate to apply to each element to determine if it should be included- Returns:
- a new filter
-
map
Filter<T,R> map(Function<? super T,? extends T> mapper)
Return a filter with the results of applying the given mapper function.- Parameters:
mapper
- a non-interfering, stateless function to apply to each element- Returns:
- a new filter
-
flatMap
Filter<T,R> flatMap(Function<? super T,? extends List<T>> mapper)
Return a filter consisting of the results of replacing each element with the contents of the mapped elements.- Parameters:
mapper
- a non-interfering, stateless function to apply to each element which produces a list of new values- Returns:
- a new filter
-
listMap
Filter<T,R> listMap(Function<? super List<T>,? extends List<T>> mapper)
Return a filter with the results of the applying given mapper function.- Parameters:
mapper
- a non-interfering, stateless function to apply to the existing elements- Returns:
- a new filter
-
-