@SuppressWarnings("unchecked")
private Object calculate(SimpleFeatureCollection featureCollection) {
try {
int classNum = getClasses();
//use a visitor to grab the unique values
UniqueVisitor uniqueVisit = new UniqueVisitor(getParameters().get(0));
if (progress == null) progress = new NullProgressListener();
featureCollection.accepts(uniqueVisit, progress);
if (progress.isCanceled()) return null;
CalcResult calcResult = uniqueVisit.getResult();
if (calcResult == null) return null;
List result = calcResult.toList();
//sort the results and put them in an array
Collections.sort(result, new Comparator() {
public int compare(Object o1, Object o2) {