Ignore:
Timestamp:
03/04/13 08:25:34 (12 years ago)
Author:
wojtekp
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ResourceConsumptionProfile.java

    r883 r896  
    11package schedframe.scheduling.tasks.phases; 
    22 
    3 import java.util.ArrayList; 
     3import java.util.LinkedList; 
    44import java.util.List; 
    55 
    66public class ResourceConsumptionProfile { 
    77         
    8         protected List<ResourceConsumption> resourceConsumptionList; 
     8        protected LinkedList<ResourceConsumption> resourceConsumptionList; 
     9        protected int currentPhase; 
    910         
    1011        public ResourceConsumptionProfile() { 
    11                 this.resourceConsumptionList = new ArrayList<ResourceConsumption>(); 
     12                this.resourceConsumptionList = new LinkedList<ResourceConsumption>(); 
     13                this.currentPhase = -1; 
    1214        } 
    1315         
    14         public ResourceConsumptionProfile(List<ResourceConsumption> resourceConsumptionList) { 
     16        public ResourceConsumptionProfile(LinkedList<ResourceConsumption> resourceConsumptionList) { 
    1517                this.resourceConsumptionList = resourceConsumptionList; 
     18                this.currentPhase = -1; 
     19        } 
     20         
     21        public LinkedList<ResourceConsumption> getResourceConsumptionList(){ 
     22                return resourceConsumptionList; 
     23        } 
     24         
     25        public ResourceConsumption getCurrentResourceConsumption(){ 
     26                if(currentPhase < resourceConsumptionList.size()) 
     27                        return resourceConsumptionList.get(currentPhase); 
     28                else  
     29                        return null; 
     30        } 
     31 
     32        public int getCurrentPhase() { 
     33                return currentPhase; 
     34        } 
     35 
     36        public void setCurrentPhase(int currentPhase) { 
     37                this.currentPhase = currentPhase; 
    1638        } 
    1739} 
Note: See TracChangeset for help on using the changeset viewer.