Skip to content

Aggregation or partition structure added to Iterables #1010

@gissuebot

Description

@gissuebot

Original issue created by em...@soldal.org on 2012-05-23 at 04:42 PM


In ref to https://groups.google.com/d/topic/guava-discuss/NfE09gFfPjU/discussion

This issue discusses the addition of the following three methods to Iterables:

Iterable<List<T>> partition(Iterable<T> iterable, Comparator<T> comparator)
Iterable<List<T>> parition(Iterable<T> iterable, Equivalence<T> equivalence)
Iterable<List<T>> parition(Iterable<T extends Comparable<? super T>> iterable)

The proposed function of these methods would be to group or chunk like items together without disrupting the order of the elements or their occurrence in the underlying iterable or boundaries in the underlying iterable.

As a side-effect of this it would also be prudent to add something to Equivalences like Equivalence<T> from(Comparator<T> comparator) for completeness.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions