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
Method Summary |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
callback
private Grouper.Callback<ElementType> callback
Grouper
public Grouper(Grouper.Callback<ElementType> callback)
- Creates a new instance of Grouper.
- Parameters:
callback
- the callback which receives the groups and elements
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