r319 - in trunk/coser-business/src/main/java/fr/ifremer/coser: control services
Author: chatellier Date: 2010-12-01 13:08:42 +0000 (Wed, 01 Dec 2010) New Revision: 319 Log: Tri alphabetique des erreurs diff capture/taille sur le nom de l'espece Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/control/DiffCatchLengthControlError.java trunk/coser-business/src/main/java/fr/ifremer/coser/services/ControlService.java Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/control/DiffCatchLengthControlError.java =================================================================== --- trunk/coser-business/src/main/java/fr/ifremer/coser/control/DiffCatchLengthControlError.java 2010-12-01 12:57:49 UTC (rev 318) +++ trunk/coser-business/src/main/java/fr/ifremer/coser/control/DiffCatchLengthControlError.java 2010-12-01 13:08:42 UTC (rev 319) @@ -25,6 +25,7 @@ package fr.ifremer.coser.control; + /** * Erreur de controle specifique pour les différences des nombres entre * les captures et les tailles pour utilisation typée de cette erreur @@ -36,7 +37,7 @@ * Last update : $Date$ * By : $Author$ */ -public class DiffCatchLengthControlError extends ControlError { +public class DiffCatchLengthControlError extends ControlError implements Comparable<DiffCatchLengthControlError> { /** serialVersionUID. */ private static final long serialVersionUID = -3254763296138201677L; @@ -50,4 +51,13 @@ public void setSpecies(String species) { this.species = species; } + + @Override + public int compareTo(DiffCatchLengthControlError o) { + int result = -1; + if (species != null) { + result = species.compareTo(o.species); + } + return result; + } } Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/ControlService.java =================================================================== --- trunk/coser-business/src/main/java/fr/ifremer/coser/services/ControlService.java 2010-12-01 12:57:49 UTC (rev 318) +++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/ControlService.java 2010-12-01 13:08:42 UTC (rev 319) @@ -29,6 +29,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -221,7 +222,7 @@ } // validation entre catch et length (specific) - List<ControlError> diffCatchLengthErrors = validateDiffCatchLength(control); + List<? extends ControlError> diffCatchLengthErrors = validateDiffCatchLength(control, progress); if (diffCatchLengthErrors != null) { validationErrors.addAll(diffCatchLengthErrors); } @@ -550,14 +551,17 @@ * Detecte des différences entre les nombres dans captures * et les nombres dand taille. * + * @param control data container + * @param progress progress + * * @see PublicationService#getCompareCatchLengthGraph(Project, Control, String) for details * @see CoserBusinessConfig#getControlDiffCatchLength() for option * * @return errors */ - protected List<ControlError> validateDiffCatchLength(Control control) { + protected List<? extends ControlError> validateDiffCatchLength(Control control, ProgressMonitor progress) { - List<ControlError> validationErrors = new ArrayList<ControlError>(); + List<DiffCatchLengthControlError> validationErrors = new ArrayList<DiffCatchLengthControlError>(); SortedSet<String> setYear = new TreeSet<String>(); // look for data (data summed over catch) @@ -674,7 +678,10 @@ } } } - + + // classer les warning sur les controle de différences capture/taille + // par ordre alphabetique des noms d'especes + Collections.sort(validationErrors); return validationErrors; }
participants (1)
-
chatellier@users.labs.libre-entreprise.org