r736 - trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches
Author: tchemit Date: 2013-04-04 21:02:11 +0200 (Thu, 04 Apr 2013) New Revision: 736 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/736 Log: reformat + import + ... Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java =================================================================== --- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java 2013-04-04 19:01:21 UTC (rev 735) +++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java 2013-04-04 19:02:11 UTC (rev 736) @@ -1,7 +1,36 @@ package fr.ifremer.tutti.service.catches; +/* + * #%L + * Tutti :: Service + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 - 2013 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + import fr.ifremer.tutti.TuttiBusinessException; -import fr.ifremer.tutti.persistence.entities.data.*; +import fr.ifremer.tutti.persistence.entities.data.BatchContainer; +import fr.ifremer.tutti.persistence.entities.data.CatchBatch; +import fr.ifremer.tutti.persistence.entities.data.FishingOperation; +import fr.ifremer.tutti.persistence.entities.data.SortedUnsortedEnum; +import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch; +import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency; import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue; import fr.ifremer.tutti.service.AbstractTuttiService; import fr.ifremer.tutti.service.PersistenceService; @@ -10,7 +39,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import javax.swing.*; import java.util.List; import static org.nuiton.i18n.I18n._; @@ -33,8 +61,8 @@ } public void computeCatchBatchWeights(CatchBatch catchBatch, - BatchContainer<SpeciesBatch> rootSpeciesBatch, - BatchContainer<SpeciesBatch> rootBenthosBatch) { + BatchContainer<SpeciesBatch> rootSpeciesBatch, + BatchContainer<SpeciesBatch> rootBenthosBatch) { // Species Float speciesTotalComputedSortedWeight = 0f; @@ -165,11 +193,10 @@ + totalSortedWeight)) { throw new TuttiBusinessException(_("tutti.service.catches.computeWeights.error.incoherentTotal")); - } else { - catchBatch.setCatchTotalRejectedComputedWeight(totalWeight - - totalUnsortedWeight - - totalSortedWeight); } + catchBatch.setCatchTotalRejectedComputedWeight(totalWeight + - totalUnsortedWeight + - totalSortedWeight); } else if (totalWeight == null) { if (rejectedWeight == null) { @@ -177,8 +204,8 @@ catchBatch.setCatchTotalRejectedComputedWeight(0f); } catchBatch.setCatchTotalComputedWeight(totalUnsortedWeight - + totalSortedWeight - + rejectedWeight); + + totalSortedWeight + + rejectedWeight); } else if (!totalWeight.equals(totalUnsortedWeight + totalSortedWeight + rejectedWeight)) { throw new TuttiBusinessException(_("tutti.service.catches.computeWeights.error.incoherentTotal")); @@ -193,8 +220,7 @@ if (rootSpeciesBatch != null) { List<SpeciesBatch> roots = rootSpeciesBatch.getChildren(); - for (int i = 0; i < roots.size(); i++) { - SpeciesBatch batch = roots.get(i); + for (SpeciesBatch batch : roots) { computeSpeciesBatch(batch); } } @@ -209,8 +235,7 @@ List<SpeciesBatch> roots = rootBenthosBatch.getChildren(); - for (int i = 0; i < roots.size(); i++) { - SpeciesBatch batch = roots.get(i); + for (SpeciesBatch batch : roots) { computeSpeciesBatch(batch); } @@ -300,7 +325,7 @@ result = frequencyWeight; } else if (frequencyWeight != null - && !frequencyWeight.equals(categoryWeight)) { + && !frequencyWeight.equals(categoryWeight)) { // if the weight of the frequencies is different from the category // weight, then set the weight of the sample Property changes on: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native
participants (1)
-
tchemit@users.forge.codelutin.com