source: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyEvent.java @ 819

Revision 819, 1.2 KB checked in by wojtekp, 12 years ago (diff)
  • Property svn:mime-type set to text/plain
Line 
1package schedframe.resources.computing.profiles.energy;
2
3import schedframe.events.Event;
4import schedframe.events.EventType;
5import schedframe.events.scheduling.EventReason;
6
7
8public class EnergyEvent implements Event{
9
10        protected EventType type;
11        protected EventReason reason;
12
13        protected String source;
14        protected Object data;
15
16        public EnergyEvent(EventType eventType, String source){
17                this.type = eventType;
18                this.source = source;
19                setReason(EventReason.UNKNOWN);
20        }
21       
22        public EnergyEvent(EventType eventType, Object data){
23                this.type = eventType;
24                this.data = data;
25                setReason(EventReason.UNKNOWN);
26        }
27       
28        public EnergyEvent(EventType eventType, String source, Object data){
29                this.type = eventType;
30                this.source = source;
31                this.data = data;
32                setReason(EventReason.UNKNOWN);
33        }
34       
35        public int getTag() {
36                return type.getTag();
37        }
38
39        public Object getData() {
40                return data;
41        }
42
43        public EnergyEventType getType() {
44                EnergyEventType enEventType = null;
45                try{
46                        enEventType = (EnergyEventType)type;
47                } catch(Exception e){
48
49                }
50                return enEventType;
51
52        }
53
54        public String getSource() {
55                return source;
56        }
57
58        public EventReason getReason() {
59                return reason;
60        }
61
62        public void setReason(EventReason reason) {
63                this.reason = reason;
64        }
65}
Note: See TracBrowser for help on using the repository browser.