| Package | Description |
|---|---|
| org.opencastproject.util |
Utility classes for dealing with media packages, collections, URLs, files, and streams.
|
| org.opencastproject.util.data | |
| org.opencastproject.util.data.functions |
| Modifier and Type | Method and Description |
|---|---|
static <A> Option<A> |
IoSupport.withFile(File file,
Function2<InputStream,File,A> f)
Handle a stream inside
f and ensure that s gets closed properly. |
static <A> A |
IoSupport.withStreams(InputStream[] in,
OutputStream[] out,
Function2<InputStream[],OutputStream[],A> f)
Handle multiple streams inside
f and ensure that they get closed properly. |
| Modifier and Type | Class and Description |
|---|---|
class |
Effect2<A,B>
Run a side effect.
|
static class |
Effect2.X<A,B>
Version of
Effect0 that allows for throwing a checked exception. |
static class |
Function2.X<A,B,C>
Version of
Function2 that allows for throwing a checked exception. |
| Modifier and Type | Method and Description |
|---|---|
Function2<B,A,C> |
Function2.flip()
Argument flipping.
|
Function2<A,B,Void> |
Effect2.toFunction()
Return the effect as a function of arity 2.
|
| Modifier and Type | Method and Description |
|---|---|
static <A,B> Monadics.Matcher<A,B> |
Monadics.caseAN(Function2<A,List<A>,B> f)
Matches lists with at least one element.
|
abstract Monadics.ListMonadic<A> |
Monadics.ListMonadic.eachIndex(Function2<? super A,? super Integer,Void> e)
Apply side effect
e to each element. |
abstract Monadics.IteratorMonadic<A> |
Monadics.IteratorMonadic.eachIndex(Function2<A,Integer,Void> e)
Apply side effect
e to each element. |
static <B,C,A> Cell<A> |
Cells.fcell(Cell<B> masterB,
Cell<C> masterC,
Function2<B,C,A> f) |
abstract <B> B |
Monadics.IteratorMonadic.fold(B zero,
Function2<B,A,B> f)
Fold the elements applying binary operator
f starting with zero. |
abstract <B> B |
Monadics.ListMonadic.foldl(B zero,
Function2<? super B,? super A,? extends B> f)
Fold the list from left to right applying binary operator
f starting with zero. |
static <A,B> B |
Collections.foldl(Collection<A> as,
B start,
Function2<B,A,B> f)
Deprecated.
use
Monadics |
abstract <B> Monadics.IteratorMonadic<B> |
Monadics.IteratorMonadic.mapIndex(Function2<A,Integer,B> f)
Apply
f to each element. |
abstract A |
Monadics.IteratorMonadic.reduce(Function2<A,A,A> f)
Reduce the elements applying binary operator
f. |
abstract A |
Monadics.ListMonadic.reducel(Function2<? super A,? super A,? extends A> f)
Reduce the list from left to right applying binary operator
f. |
| Modifier and Type | Field and Description |
|---|---|
static Function2<Boolean,Boolean,Boolean> |
Booleans.and |
static Function2<Boolean,Boolean,Boolean> |
Booleans.or |
| Modifier and Type | Method and Description |
|---|---|
static Function2<Integer,Integer,Integer> |
Integers.add()
Addition.
|
static <A,B> Function2<A,B,Boolean> |
Booleans.and2(Function<A,Boolean> f,
Function<B,Boolean> g) |
static Function2<String,String,String> |
Strings.concat(String sep)
Return a string concatenation function.
|
static <A,B,C> Function2<B,A,C> |
Functions.flip(Function2<? super A,? super B,? extends C> f)
Flip arguments of a function of arity 2.
|
static <A> Function2<String,A[],String> |
Strings.format()
Return a string formatting function.
|
static <A,B,C> Function2<A,B,C> |
Functions.uncurry(Function<? super A,Function<B,C>> f)
Uncurry to a function of arity 2.
|
| Modifier and Type | Method and Description |
|---|---|
static <A,B,C> Function<A,Function<B,C>> |
Functions.curry(Function2<? super A,? super B,? extends C> f)
Curry a function of arity 2.
|
static <A,B,C> Function<B,C> |
Functions.curry(Function2<? super A,? super B,? extends C> f,
A a)
Curry a function of arity 2.
|
static <A,B,C> Function2<B,A,C> |
Functions.flip(Function2<? super A,? super B,? extends C> f)
Flip arguments of a function of arity 2.
|
static <A,B,C> Effect2<A,B> |
Functions.toEffect(Function2<? super A,? super B,? extends C> f)
Turn a function of arity 2 into an effect by discarding its result.
|
static <A,B,C> Function<Tuple<A,B>,C> |
Functions.tupled(Function2<? super A,? super B,? extends C> f)
Create a tupled version of a function of arity 2.
|
Copyright © 2009–2021 Opencast Project. All rights reserved.