Interface BiStream.Partitioner<A,B>

Enclosing class:
BiStream<K,V>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface BiStream.Partitioner<A,B>
A predicate used to partition a BiStream into sub-groups of consecutive pairs.

Aside from that it operates on pairs, logically a "Partitioner" is unlike com.google.common.base.Equivalence in that it doesn't need to be reflexive. For example, one may use (v1, v2) -> v1 < v2 to partition ascending sub-sequences into groups, such that [1, 2, 3] results in a single group while [3, 2, 1] will be 3 groups: [[3], [2], [1]].

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    belong(A a1, B b1, A a2, B b2)
    Returns true if consecutive pair (a1, b1) and (a2, b2) belong to the same partition.
  • Method Details

    • belong

      boolean belong(A a1, B b1, A a2, B b2)
      Returns true if consecutive pair (a1, b1) and (a2, b2) belong to the same partition.