Uses of Interface
org.organicdesign.fp.function.Fn1
-
Packages that use Fn1 Package Description org.organicdesign.fp.collections Type-safe versions of immutable collections (mostly from Clojure), plus unmodifiable and immutable collection interfaces that fit these collections into the java.util interfaces.org.organicdesign.fp.function Exception-friendly functional interfaces named by the number of arguments: Fn0, Fn1, Fn2....org.organicdesign.fp.oneOf This package contains Option which has Some() and None() which is useful for indicating "Not-Found" or "End-of-stream/file".org.organicdesign.fp.xform Immutable descriptions of data transformations (Transformable), and a highly efficient single-pass, short-circuiting implementation that carries out those transforms in a single pass (Xform). -
-
Uses of Fn1 in org.organicdesign.fp.collections
Methods in org.organicdesign.fp.collections with parameters of type Fn1 Modifier and Type Method Description default @NotNull UnmodIterable<T>UnmodIterable. dropWhile(@NotNull Fn1<? super T,Boolean> predicate)Ignore leading items until the given predicate returns false.default @NotNull UnmodIterable<T>UnmodIterable. filter(@NotNull Fn1<? super T,Boolean> f)Return only the items for which the given predicate returns true.default <B> @NotNull UnmodIterable<B>UnmodIterable. flatMap(@NotNull Fn1<? super T,Iterable<B>> f)Transform each item into zero or more new items using the given function.<R> UnmodSortedIterator<R>PersistentTreeMap. iterator(Fn1<org.organicdesign.fp.collections.PersistentTreeMap.Node<K,V>,R> aFn)default <B> @NotNull UnmodIterable<B>UnmodIterable. map(@NotNull Fn1<? super T,? extends B> f)Transform each item into exactly one new item using the given function.default @NotNull UnmodIterable<T>UnmodIterable. takeWhile(@NotNull Fn1<? super T,Boolean> f)Return items from the beginning until the given predicate returns false. -
Uses of Fn1 in org.organicdesign.fp.function
Classes in org.organicdesign.fp.function that implement Fn1 Modifier and Type Class Description static classFn1.ConstObjBoolConstant functions that take an Object and return a Booleanstatic classFn1.ConstObjObjConstant functions that take an Object and return an ObjectMethods in org.organicdesign.fp.function that return Fn1 Modifier and Type Method Description static <T> @NotNull Fn1<T,Boolean>Fn1. accept()Returns a type-safe version of theFn1.ConstObjBool.ACCEPTpredicate.static <S> @NotNull Fn1<S,Boolean>Fn1. and(@NotNull Fn1<S,Boolean> a, @NotNull Fn1<S,Boolean> b)static <T> @NotNull Fn1<T,Boolean>Fn1. and(@Nullable Iterable<@Nullable Fn1<T,Boolean>> in)Composes multiple predicates into a single predicate to potentially minimize trips through the source data.abstract <T> @NotNull Fn1<T,Boolean>Fn1.BooleanCombiner. combine(Iterable<Fn1<T,Boolean>> in)default <S> @NotNull Fn1<S,U>Fn1. compose(@NotNull Fn1<? super S,? extends T> f)static <V> @NotNull Fn1<V,V>Fn1. compose(@Nullable Iterable<@Nullable Fn1<V,V>> in)Composes multiple functions into a single function to potentially minimize trips through the source data.static <V> @NotNull Fn1<V,V>Fn1. identity()static <A,B>
@NotNull Fn1<A,B>Fn1. memoize(@NotNull Fn1<A,B> f)Use only on pure functions with no side effects.static <S> @NotNull Fn1<S,Boolean>Fn1. negate(@NotNull Fn1<? super S,Boolean> a)static <S> @NotNull Fn1<S,Boolean>Fn1. or(@NotNull Fn1<S,Boolean> a, @NotNull Fn1<S,Boolean> b)static <T> @NotNull Fn1<T,Boolean>Fn1. or(@Nullable Iterable<@Nullable Fn1<T,Boolean>> in)Composes multiple predicates into a single predicate to potentially minimize trips through the source data.static <T> @NotNull Fn1<T,Boolean>Fn1. reject()Returns a type-safe version of theFn1.ConstObjBool.REJECTpredicate.Methods in org.organicdesign.fp.function with parameters of type Fn1 Modifier and Type Method Description static <S> @NotNull Fn1<S,Boolean>Fn1. and(@NotNull Fn1<S,Boolean> a, @NotNull Fn1<S,Boolean> b)default <S> @NotNull Fn1<S,U>Fn1. compose(@NotNull Fn1<? super S,? extends T> f)static <A,B>
@NotNull Fn1<A,B>Fn1. memoize(@NotNull Fn1<A,B> f)Use only on pure functions with no side effects.static <S> @NotNull Fn1<S,Boolean>Fn1. negate(@NotNull Fn1<? super S,Boolean> a)static <S> @NotNull Fn1<S,Boolean>Fn1. or(@NotNull Fn1<S,Boolean> a, @NotNull Fn1<S,Boolean> b)Method parameters in org.organicdesign.fp.function with type arguments of type Fn1 Modifier and Type Method Description static <T> @NotNull Fn1<T,Boolean>Fn1. and(@Nullable Iterable<@Nullable Fn1<T,Boolean>> in)Composes multiple predicates into a single predicate to potentially minimize trips through the source data.abstract <T> @NotNull Fn1<T,Boolean>Fn1.BooleanCombiner. combine(Iterable<Fn1<T,Boolean>> in)static <V> @NotNull Fn1<V,V>Fn1. compose(@Nullable Iterable<@Nullable Fn1<V,V>> in)Composes multiple functions into a single function to potentially minimize trips through the source data.static <T> @NotNull Fn1<T,Boolean>Fn1. or(@Nullable Iterable<@Nullable Fn1<T,Boolean>> in)Composes multiple predicates into a single predicate to potentially minimize trips through the source data. -
Uses of Fn1 in org.organicdesign.fp.oneOf
Methods in org.organicdesign.fp.oneOf with parameters of type Fn1 Modifier and Type Method Description <U> UNone. match(@NotNull Fn1<T,U> has, @NotNull Fn0<U> hasNot)Pass in a function to execute if its Some and another to execute if its None.<R> ROneOf2. match(@NotNull Fn1<A,R> fa, @NotNull Fn1<B,R> fb)Languages that have union types built in have a match statement that works like this method.<R> ROneOf3. match(@NotNull Fn1<A,R> fa, @NotNull Fn1<B,R> fb, @NotNull Fn1<C,R> fc)Languages that have union types built in have a match statement that works like this method.<R> ROneOf4. match(@NotNull Fn1<A,R> fa, @NotNull Fn1<B,R> fb, @NotNull Fn1<C,R> fc, @NotNull Fn1<D,R> fd)Languages that have union types built in have a match statement that works like this method.<R> ROneOf5. match(@NotNull Fn1<A,R> fa, @NotNull Fn1<B,R> fb, @NotNull Fn1<C,R> fc, @NotNull Fn1<D,R> fd, @NotNull Fn1<E,R> fe)Languages that have union types built in have a match statement that works like this method.<U> UOption. match(@NotNull Fn1<T,U> has, @NotNull Fn0<U> hasNot)Pass in a function to execute if its Some and another to execute if its None.<U> UOption.Some. match(@NotNull Fn1<T,U> has, @NotNull Fn0<U> hasNot)Pass in a function to execute if its Some and another to execute if its None.<R> ROr.Bad. match(@NotNull Fn1<G,R> fg, @NotNull Fn1<B,R> fb)Exactly one of these functions will be executed - determined by whether this is a Good or a Bad.<R> ROr.Good. match(@NotNull Fn1<G,R> fg, @NotNull Fn1<B,R> fb)Exactly one of these functions will be executed - determined by whether this is a Good or a Bad.<R> ROr. match(@NotNull Fn1<G,R> fg, @NotNull Fn1<B,R> fb)Exactly one of these functions will be executed - determined by whether this is a Good or a Bad.<U> Option<U>None. then(Fn1<T,Option<U>> f)If this is Some, Apply the given function, else return None.<U> Option<U>Option.Some. then(@NotNull Fn1<T,Option<U>> f)If this is Some, Apply the given function, else return None.<U> Option<U>Option. then(Fn1<T,Option<U>> f)If this is Some, Apply the given function, else return None. -
Uses of Fn1 in org.organicdesign.fp.xform
Methods in org.organicdesign.fp.xform with parameters of type Fn1 Modifier and Type Method Description default booleanTransformable. any(@NotNull Fn1<? super T,Boolean> predicate)Return only the items for which the given predicate returns true.@NotNull Transformable<T>Transformable. dropWhile(@NotNull Fn1<? super T,Boolean> predicate)Ignore leading items until the given predicate returns false.@NotNull Xform<A>Xform. dropWhile(@NotNull Fn1<? super A,Boolean> predicate)The number of items to drop from the beginning of the output.@NotNull Transformable<T>Transformable. filter(@NotNull Fn1<? super T,Boolean> predicate)Return only the items for which the given predicate returns true.@NotNull Xform<A>Xform. filter(@NotNull Fn1<? super A,Boolean> f)<U> @NotNull Transformable<U>Transformable. flatMap(@NotNull Fn1<? super T,Iterable<U>> f)Transform each item into zero or more new items using the given function.<B> @NotNull Xform<B>Xform. flatMap(@NotNull Fn1<? super A,Iterable<B>> f)<U> @NotNull Transformable<U>Transformable. map(@NotNull Fn1<? super T,? extends U> func)Transform each item into exactly one new item using the given function.<B> @NotNull Xform<B>Xform. map(@NotNull Fn1<? super A,? extends B> f)@NotNull Transformable<T>Transformable. takeWhile(@NotNull Fn1<? super T,Boolean> predicate)Return items from the beginning until the given predicate returns false.@NotNull Xform<A>Xform. takeWhile(@NotNull Fn1<? super A,Boolean> f)default <K,V>
@NotNull ImMap<K,V>Transformable. toImMap(@NotNull Fn1<? super T,Map.Entry<K,V>> f1)Realize an unordered immutable hash map to very quickly O(1) look up values by key, but don't care about ordering.default <K,V>
@NotNull ImSortedMap<K,V>Transformable. toImSortedMap(Comparator<? super K> comp, @NotNull Fn1<? super T,Map.Entry<K,V>> f1)Realize an immutable, ordered (tree) map to quickly O(log2 n) look up values by key, but still retrieve entries in key order.default <K,V>
@NotNull MutMap<K,V>Transformable. toMutMap(@NotNull Fn1<? super T,Map.Entry<K,V>> f1)Realize a mutable hash map.default <K,V>
@NotNull SortedMap<K,V>Transformable. toMutSortedMap(@Nullable Comparator<? super K> comp, @NotNull Fn1<? super T,Map.Entry<K,V>> f1)Realize a mutable tree map.
-