tags:

views:

65

answers:

2

What do these lines of code do?

private interface ComparisonCallback<ComparisonT>
{
    public ComparisonT getComparisonValue(CVRDataElement e);
}

followed by this method declaration:

public <ComparisonType> List<MyDataTable> getGenericSubTable(ComparisonCallback<ComparisonType> cc)

Specifically, I don't understand the ComparisonType tag - does this have to do with generics?

+1  A: 

does this have to do with generics

Yes. You can read up about generics here.

BlueRaja - Danny Pflughoeft
Thanks for the link - what I had read previously on generics didn't explain type parameters.
george smiley
A: 

The first interface is the definition of a callback function to be used in the getGenericSubTable method.

The getGenericSubTable parameterizes the return value of the callback function, so it's saying that to do what it needs to do it needs the callback function but that it doesn't care what the type of its return type is.

What it probably means is that you use the callback to return the object that you want it to use for comparison from the CRVDataElement object.

Tom