source: DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ResourceConsumptionProfile.java @ 896

Revision 896, 1018 bytes checked in by wojtekp, 12 years ago (diff)
Line 
1package schedframe.scheduling.tasks.phases;
2
3import java.util.LinkedList;
4import java.util.List;
5
6public class ResourceConsumptionProfile {
7       
8        protected LinkedList<ResourceConsumption> resourceConsumptionList;
9        protected int currentPhase;
10       
11        public ResourceConsumptionProfile() {
12                this.resourceConsumptionList = new LinkedList<ResourceConsumption>();
13                this.currentPhase = -1;
14        }
15       
16        public ResourceConsumptionProfile(LinkedList<ResourceConsumption> resourceConsumptionList) {
17                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;
38        }
39}
Note: See TracBrowser for help on using the repository browser.