KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > scalagent > scheduler > event > BasedPeriodicEvent


1 /*
2  * Copyright (C) 2001 - 2005 ScalAgent Distributed Technologies
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17  * USA.
18  *
19  * Initial developer(s): ScalAgent Distributed Technologies
20  * Contributor(s):
21  */

22 package com.scalagent.scheduler.event;
23
24 /**
25  * The <code>PeriodicEvent</code> class extends <code>PeriodicEvent</code>
26  * to allow for a dynamic setting of the reference date. This extension does
27  * not allow field masking.
28  */

29 public class BasedPeriodicEvent extends PeriodicEvent
30   implements BasedDiaryEvent {
31   /**
32    * Default constructor.
33    * Creates an event to be initialized by the field accessors.
34    */

35   public BasedPeriodicEvent() {}
36
37   /**
38    * Constructor setting all fields.
39    *
40    * @param timeZoneId id of the time zone to be used when computing dates
41    * @param period period definition
42    */

43   public BasedPeriodicEvent(String JavaDoc timeZoneId, DiaryPeriod period) {
44     super(timeZoneId, -1, period);
45   }
46
47   /**
48    * Constructor with default time zone.
49    *
50    * @param period period definition
51    */

52   public BasedPeriodicEvent(DiaryPeriod period) {
53     this(null, period);
54   }
55
56   /**
57    * Sets the base date from which the event dates are computed.
58    * Actually sets {@link refDate}.
59    *
60    * @param baseDate
61    * base date from which the event dates are computed
62    */

63   public void setBaseDate(long baseDate) {
64     setRefDate(baseDate);
65   }
66 }
67
Popular Tags