Package edu.umd.cs.findbugs.gui
Class Grouper<ElementType>
- java.lang.Object
-
- edu.umd.cs.findbugs.gui.Grouper<ElementType>
-
public class Grouper<ElementType> extends java.lang.Object
Given a sorted Collection and a Comparator, produces groups of objects that compare as equal. If the Collection is not sorted, this class will not work correctly.- Author:
- David Hovemeyer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Grouper.Callback<ElementType2>
-
Constructor Summary
Constructors Constructor Description Grouper(Grouper.Callback<ElementType> callback)
Creates a new instance of Grouper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
group(java.util.Collection<ElementType> collection, java.util.Comparator<ElementType> comparator)
Group elements of given collection according to given compartor's test for equality.
-
-
-
Constructor Detail
-
Grouper
public Grouper(Grouper.Callback<ElementType> callback)
Creates a new instance of Grouper.- Parameters:
callback
- the callback which receives the groups and elements
-
-
Method Detail
-
group
public void group(java.util.Collection<ElementType> collection, java.util.Comparator<ElementType> comparator)
Group elements of given collection according to given compartor's test for equality. The groups are specified by calls to the Grouper's callback object.- Parameters:
collection
- the collectioncomparator
- the comparator
-
-