Class ToCollection<A,C extends java.util.Collection<A>>
- java.lang.Object
-
- com.jnape.palatable.lambda.functions.builtin.fn2.ToCollection<A,C>
-
- Type Parameters:
A
- the iterable element typeC
- the resulting collection type
- All Implemented Interfaces:
Fn1<Fn0<C>,Fn1<java.lang.Iterable<A>,C>>
,Fn2<Fn0<C>,java.lang.Iterable<A>,C>
,Applicative<Fn1<java.lang.Iterable<A>,C>,Fn1<Fn0<C>,?>>
,Cartesian<Fn0<C>,Fn1<java.lang.Iterable<A>,C>,Fn1<?,?>>
,Cocartesian<Fn0<C>,Fn1<java.lang.Iterable<A>,C>,Fn1<?,?>>
,Contravariant<Fn0<C>,Profunctor<?,Fn1<java.lang.Iterable<A>,C>,Fn1<?,?>>>
,Functor<Fn1<java.lang.Iterable<A>,C>,Fn1<Fn0<C>,?>>
,Profunctor<Fn0<C>,Fn1<java.lang.Iterable<A>,C>,Fn1<?,?>>
,Monad<Fn1<java.lang.Iterable<A>,C>,Fn1<Fn0<C>,?>>
,MonadReader<Fn0<C>,Fn1<java.lang.Iterable<A>,C>,Fn1<Fn0<C>,?>>
,MonadRec<Fn1<java.lang.Iterable<A>,C>,Fn1<Fn0<C>,?>>
,MonadWriter<Fn0<C>,Fn1<java.lang.Iterable<A>,C>,Fn1<Fn0<C>,?>>
public final class ToCollection<A,C extends java.util.Collection<A>> extends java.lang.Object implements Fn2<Fn0<C>,java.lang.Iterable<A>,C>
Given anFn0
of someCollection
C
, create an instance ofC
and add all of the elements in the providedIterable
to the instance. Note that instances ofC
must supportCollection.add(E)
(which is to say, must not throw on invocation).
-
-
Field Summary
Fields Modifier and Type Field Description private static ToCollection<?,?>
INSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description private
ToCollection()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description C
checkedApply(Fn0<C> cFn0, java.lang.Iterable<A> as)
static <A,C extends java.util.Collection<A>>
ToCollection<A,C>toCollection()
static <A,C extends java.util.Collection<A>>
Fn1<java.lang.Iterable<A>,C>toCollection(Fn0<C> cFn0)
static <A,C extends java.util.Collection<A>>
CtoCollection(Fn0<C> cFn0, java.lang.Iterable<A> as)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.jnape.palatable.lambda.functions.Fn1
andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, lazyZip, listens, local, pure, self, thunk, toFunction, trampolineM, zip, zip
-
-
-
-
Field Detail
-
INSTANCE
private static final ToCollection<?,?> INSTANCE
-
-
Method Detail
-
toCollection
public static <A,C extends java.util.Collection<A>> ToCollection<A,C> toCollection()
-
toCollection
public static <A,C extends java.util.Collection<A>> Fn1<java.lang.Iterable<A>,C> toCollection(Fn0<C> cFn0)
-
toCollection
public static <A,C extends java.util.Collection<A>> C toCollection(Fn0<C> cFn0, java.lang.Iterable<A> as)
-
-