ItEr26S07CUAsignacionGrupoRecursosAPlanificacionItEr25S07: Removing unused methods from interface and implementation

This commit is contained in:
Óscar González Fernández 2009-09-14 20:17:38 +02:00
parent 7fe75ad88f
commit 979a4978c6
2 changed files with 1 additions and 51 deletions

View file

@ -41,13 +41,6 @@ public interface IResourceAllocationModel {
*/
Set<Criterion> getCriterions();
/**
* Returns {@link Set} of {@link GenericResourceAllocation} of current
*
* @return
*/
Set<GenericResourceAllocation> getGenericResourceAllocations();
/**
* Returns the {@link Set} of {@link ResourceAllocation} of the current
* {@link Task}.
@ -96,15 +89,6 @@ public interface IResourceAllocationModel {
*/
void setTask(Task task);
/**
* Update the duration of the current Gantt
* {@link org.zkoss.ganttz.data.Task ganttTask}, depending on the resources
* assigned and the dedication.
*
* @param ganttTask
*/
void updateGanttTaskDuration();
/**
* Cancel operation
*/

View file

@ -4,7 +4,6 @@ import static org.navalplanner.web.I18nHelper._;
import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
@ -16,7 +15,6 @@ import org.navalplanner.business.planner.entities.GenericResourceAllocation;
import org.navalplanner.business.planner.entities.ResourceAllocation;
import org.navalplanner.business.planner.entities.SpecificResourceAllocation;
import org.navalplanner.business.planner.entities.Task;
import org.navalplanner.business.resources.daos.IResourceDAO;
import org.navalplanner.business.resources.daos.IWorkerDAO;
import org.navalplanner.business.resources.entities.Criterion;
import org.navalplanner.business.resources.entities.CriterionSatisfaction;
@ -47,9 +45,6 @@ public class ResourceAllocationModel implements IResourceAllocationModel {
@Autowired
private IHoursGroupDAO hoursGroupDAO;
@Autowired
private IResourceDAO resourceDAO;
@Autowired
private IResourceAllocationDAO resourceAllocationDAO;
@ -150,7 +145,7 @@ public class ResourceAllocationModel implements IResourceAllocationModel {
reattachWorker(worker);
// Check if worker was itself a generic resource
if (worker.satisfiesCriterions(getCriterions())) {
Set<GenericResourceAllocation> genericResourceAllocations = getGenericResourceAllocations();
Set<GenericResourceAllocation> genericResourceAllocations = task.getGenericResourceAllocations();
// Generic resources always match criterions, so we need to remove
// one generic resource to leave room for a specific resource
if (genericResourceAllocations.size() > 0) {
@ -161,12 +156,6 @@ public class ResourceAllocationModel implements IResourceAllocationModel {
task.addResourceAllocation(resourceAllocation);
}
@Override
@Transactional(readOnly = true)
public Set<GenericResourceAllocation> getGenericResourceAllocations() {
return task.getGenericResourceAllocations();
}
@Override
public void removeResourceAllocation(ResourceAllocation resourceAllocation) {
task.removeResourceAllocation(resourceAllocation);
@ -204,21 +193,6 @@ public class ResourceAllocationModel implements IResourceAllocationModel {
}
}
@SuppressWarnings("unchecked")
private BigDecimal getSumPercentage(Set resourceAllocations) {
BigDecimal result = new BigDecimal(0);
for (Iterator i = resourceAllocations.iterator(); i.hasNext();) {
ResourceAllocation resourceAllocation = (ResourceAllocation) i.next();
BigDecimal percentage = (resourceAllocation.getPercentage() != null) ? resourceAllocation
.getPercentage()
: new BigDecimal(0);
result = result.add(percentage);
}
return result;
}
private SpecificResourceAllocation findSpecificResourceAllocationByWorker(Worker worker) {
for (SpecificResourceAllocation resourceAllocation : task
.getSpecificResourceAllocations()) {
@ -248,14 +222,6 @@ public class ResourceAllocationModel implements IResourceAllocationModel {
this.ganttTask = ganttTask;
}
@Override
@Transactional(readOnly = true)
public void updateGanttTaskDuration() {
taskElementDAO.save(task);
task.getDuration();
ganttTask.setEndDate(task.getEndDate());
}
@Override
public void cancel() {
task.clearResourceAllocations();