Java 8 BiFunction - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 BiFunction class.

This code example shows how to use the following methods:apply
This code example shows how to use the following methods:apply
    private final BiFunction<V, S, V> operator;
 
    public SackObjectStep(final Traversal traversal, final BiFunction<V, S, V> operator) {
        super(traversal);
        this.operator = operator;
        this.setConsumer(traverser -> traverser.sack(this.operator.apply(traverser.sack(), traverser.get())));
    } 
} 
4
CodeRank
This code example shows how to use the following methods:apply
    public <B2> T2<A, B2> withSecond(B2 b2) {
        return T2.of(a, b2);
    } 
 
    public <R> R sendTo(BiFunction<A, B, R> f) {
        return f.apply(a, b);
    } 
 
    public <C> T3<A, B, C> push(C c) {
        return Tuple.of(a, b, c);
    } 
 
    public T2<B, T1<A>> pop() { 
        return Tuple.of(b, Tuple.of(a));
    } 
 
    public T2<A, T1<B>> shift() { 
        return Tuple.of(a, Tuple.of(b));
    } 
 
3
CodeRank
This code example shows how to use the following methods:apply
    } 
    public void with(BiConsumer<T, U> cons){
        cons.accept(left, right);
    } 
    public<R> R reduce(BiFunction<T, U, R> func){
        return func.apply(left, right);
    } 
    public<M, N> Pair<M, N> map(Function<T, M> lfunc, Function<U, N> rfunc){
        return of(lfunc.apply(left), rfunc.apply(right));
    } 
    public<M, N> Pair<M, N> flatMap(BiFunction<T, U, Pair<M, N>> func){
        return func.apply(left, right);
    } 
} 
3
CodeRank
See Code Examples for Java 8 BiFunction Methods: