1 package org.oddjob.schedules; 2 3 import java.io.Serializable ; 4 5 6 7 12 13 14 abstract public class AbstractSchedule 15 implements Serializable , RefineableSchedule { 16 17 private static final long serialVersionUID = 20050226; 18 19 20 private Schedule childSchedule; 21 22 23 private Interval limits; 24 25 29 public void setLimits(Interval limits) { 30 this.limits = limits; 31 } 32 33 38 public Interval getLimits() { 39 return limits; 40 } 41 42 47 public void setChildSchedule(Schedule schedule) { 48 this.childSchedule = schedule; 49 } 50 51 55 public void addValueSchedule(Schedule schedule) { 56 if (childSchedule == null) { 57 childSchedule = new ScheduleList(); 58 } 59 else if (!(childSchedule instanceof ScheduleList)) { 60 throw new IllegalStateException ("Child schedule of " + childSchedule 61 + " already exists for " + this); 62 } 63 ((ScheduleList) childSchedule).addValueSchedule(schedule); 64 } 65 66 71 public Schedule getChildSchedule() { 72 return childSchedule; 73 } 74 75 } 76 | Popular Tags |