source: DCWoRMS/trunk/src/schedframe/events/scheduling/SchedulingEvent.java @ 477

Revision 477, 996 bytes checked in by wojtekp, 13 years ago (diff)
  • Property svn:mime-type set to text/plain
RevLine 
[477]1package schedframe.events.scheduling;
2
3import schedframe.events.Event;
4import schedframe.events.EventType;
5
6public class SchedulingEvent implements Event{
7       
8        protected EventType type;
9        protected EventReason reason;
10       
11        protected String source;
12       
13        public SchedulingEvent(EventType eventType){
14                this(eventType, EventReason.UNKNOWN);
15        }
16       
17        public SchedulingEvent(EventType eventType, EventReason eventReason){
18                type = eventType;
19                reason = eventReason;
20        }
21       
22        public SchedulingEventType getType(){
23                SchedulingEventType schedEventType;
24                try{
25                        schedEventType = (SchedulingEventType)type;
26                } catch(Exception e){
27                        schedEventType = SchedulingEventType.RESOURCE_STATE_CHANGED;
28                }
29                return schedEventType;
30        }
31       
32        public EventReason getReason(){
33                return reason;
34        }
35       
36        public void setSource(String value){
37                this.source = value;
38        }
39       
40        public String getSource(){
41                return this.source;
42        }
43
44        public int getTag() {
45                return type.getTag();
46        }
47
48        @Override
49        public Object getData() {
50                return null;
51        }
52       
53}
Note: See TracBrowser for help on using the repository browser.