edu.umd.cs.findbugs.gui

Class Grouper<ElementType>

public class Grouper<ElementType> extends 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
interfaceGrouper.Callback<ElementType2>
Constructor Summary
Grouper(Callback<ElementType> callback)
Creates a new instance of Grouper.
Method Summary
voidgroup(Collection<ElementType> collection, Comparator<ElementType> comparator)
Group elements of given collection according to given compartor's test for equality.

Constructor Detail

Grouper

public 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(Collection<ElementType> collection, 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 collection comparator the comparator

FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.