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 UnmodIterable<T>UnmodIterable. dropWhile(Fn1<? super T,java.lang.Boolean> predicate)Ignore leading items until the given predicate returns false.default UnmodIterable<T>UnmodIterable. filter(Fn1<? super T,java.lang.Boolean> f)Return only the items for which the given predicate returns true.default <B> UnmodIterable<B>UnmodIterable. flatMap(Fn1<? super T,java.lang.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> UnmodIterable<B>UnmodIterable. map(Fn1<? super T,? extends B> f)Transform each item into exactly one new item using the given function.default UnmodIterable<T>UnmodIterable. takeWhile(Fn1<? super T,java.lang.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> Fn1<T,java.lang.Boolean>Fn1. accept()Returns a type-safe version of the ConstObjBool.ACCEPT predicate.static <T> Fn1<T,java.lang.Boolean>Fn1. and(java.lang.Iterable<Fn1<T,java.lang.Boolean>> in)Composes multiple predicates into a single predicate to potentially minimize trips through the source data.static <S> Fn1<S,java.lang.Boolean>Fn1. and(Fn1<S,java.lang.Boolean> a, Fn1<S,java.lang.Boolean> b)abstract <T> Fn1<T,java.lang.Boolean>Fn1.BooleanCombiner. combine(java.lang.Iterable<Fn1<T,java.lang.Boolean>> in)static <V> Fn1<V,V>Fn1. compose(java.lang.Iterable<Fn1<V,V>> in)Composes multiple functions into a single function to potentially minimize trips through the source data.default <S> Fn1<S,U>Fn1. compose(Fn1<? super S,? extends T> f)static <V> Fn1<V,V>Fn1. identity()static <A,B>
Fn1<A,B>Fn1. memoize(Fn1<A,B> f)Use only on pure functions with no side effects.static <S> Fn1<S,java.lang.Boolean>Fn1. negate(Fn1<? super S,java.lang.Boolean> a)static <T> Fn1<T,java.lang.Boolean>Fn1. or(java.lang.Iterable<Fn1<T,java.lang.Boolean>> in)Composes multiple predicates into a single predicate to potentially minimize trips through the source data.static <S> Fn1<S,java.lang.Boolean>Fn1. or(Fn1<S,java.lang.Boolean> a, Fn1<S,java.lang.Boolean> b)static <T> Fn1<T,java.lang.Boolean>Fn1. reject()Returns a type-safe version of the ConstObjBool.REJECT predicate.Methods in org.organicdesign.fp.function with parameters of type Fn1 Modifier and Type Method Description static <S> Fn1<S,java.lang.Boolean>Fn1. and(Fn1<S,java.lang.Boolean> a, Fn1<S,java.lang.Boolean> b)default <S> Fn1<S,U>Fn1. compose(Fn1<? super S,? extends T> f)static <A,B>
Fn1<A,B>Fn1. memoize(Fn1<A,B> f)Use only on pure functions with no side effects.static <S> Fn1<S,java.lang.Boolean>Fn1. negate(Fn1<? super S,java.lang.Boolean> a)static <S> Fn1<S,java.lang.Boolean>Fn1. or(Fn1<S,java.lang.Boolean> a, Fn1<S,java.lang.Boolean> b)Method parameters in org.organicdesign.fp.function with type arguments of type Fn1 Modifier and Type Method Description static <T> Fn1<T,java.lang.Boolean>Fn1. and(java.lang.Iterable<Fn1<T,java.lang.Boolean>> in)Composes multiple predicates into a single predicate to potentially minimize trips through the source data.abstract <T> Fn1<T,java.lang.Boolean>Fn1.BooleanCombiner. combine(java.lang.Iterable<Fn1<T,java.lang.Boolean>> in)static <V> Fn1<V,V>Fn1. compose(java.lang.Iterable<Fn1<V,V>> in)Composes multiple functions into a single function to potentially minimize trips through the source data.static <T> Fn1<T,java.lang.Boolean>Fn1. or(java.lang.Iterable<Fn1<T,java.lang.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(Fn1<T,U> has, Fn0<U> hasNot)Pass in a function to execute if its Some and another to execute if its None.<R> ROneOf2. match(Fn1<A,R> fa, Fn1<B,R> fb)Languages that have union types built in have a match statement that works like this method.<R> ROneOf2OrNone. match(Fn1<A,R> fa, Fn1<B,R> fb, Fn0<R> fz)Languages that have union types built in have a match statement that works like this method.<R> ROneOf3. match(Fn1<A,R> fa, Fn1<B,R> fb, Fn1<C,R> fc)Languages that have union types built in have a match statement that works like this method.<R> ROneOf4. match(Fn1<A,R> fa, Fn1<B,R> fb, Fn1<C,R> fc, Fn1<D,R> fd)Languages that have union types built in have a match statement that works like this method.<U> UOption. match(Fn1<T,U> has, Fn0<U> hasNot)Pass in a function to execute if its Some and another to execute if its None.<U> UOption.Some. match(Fn1<T,U> has, Fn0<U> hasNot)Pass in a function to execute if its Some and another to execute if its None.<R> ROr.Bad. match(Fn1<G,R> fg, 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(Fn1<G,R> fg, 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(Fn1<G,R> fg, 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(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 Transformable<T>Transformable. dropWhile(Fn1<? super T,java.lang.Boolean> predicate)Ignore leading items until the given predicate returns false.Xform<A>Xform. dropWhile(Fn1<? super A,java.lang.Boolean> predicate)The number of items to drop from the beginning of the output.Transformable<T>Transformable. filter(Fn1<? super T,java.lang.Boolean> predicate)Return only the items for which the given predicate returns true.Xform<A>Xform. filter(Fn1<? super A,java.lang.Boolean> f)<U> Transformable<U>Transformable. flatMap(Fn1<? super T,java.lang.Iterable<U>> f)Transform each item into zero or more new items using the given function.<B> Xform<B>Xform. flatMap(Fn1<? super A,java.lang.Iterable<B>> f)<U> Transformable<U>Transformable. map(Fn1<? super T,? extends U> func)Transform each item into exactly one new item using the given function.<B> Xform<B>Xform. map(Fn1<? super A,? extends B> f)Transformable<T>Transformable. takeWhile(Fn1<? super T,java.lang.Boolean> predicate)Return items from the beginning until the given predicate returns false.Xform<A>Xform. takeWhile(Fn1<? super A,java.lang.Boolean> f)default <K,V>
ImMap<K,V>Transformable. toImMap(Fn1<? super T,java.util.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>
ImSortedMap<K,V>Transformable. toImSortedMap(java.util.Comparator<? super K> comp, Fn1<? super T,java.util.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>
MutableMap<K,V>Transformable. toMutableMap(Fn1<? super T,java.util.Map.Entry<K,V>> f1)Realize a mutable hash map.default <K,V>
java.util.SortedMap<K,V>Transformable. toMutableSortedMap(java.util.Comparator<? super K> comp, Fn1<? super T,java.util.Map.Entry<K,V>> f1)Realize a mutable tree map.
-