01: /*
02: * <copyright>
03: *
04: * Copyright 1997-2004 BBNT Solutions, LLC
05: * under sponsorship of the Defense Advanced Research Projects
06: * Agency (DARPA).
07: *
08: * You can redistribute this software and/or modify it under the
09: * terms of the Cougaar Open Source License as published on the
10: * Cougaar Open Source Website (www.cougaar.org).
11: *
12: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
13: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
14: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
15: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
16: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
18: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23: *
24: * </copyright>
25: */
26:
27: package org.cougaar.planning.ldm.plan;
28:
29: import java.util.Date;
30:
31: import org.cougaar.util.TimeSpan;
32:
33: /**
34: * A ScheduleElement is an encapsulation of spatio-temporal relationships.
35: * Current thought is to bind up both time and space into a single
36: * object which may then be queried in various ways to test for
37: * overlaps, inclusion, exclusion, etc with other schedules.
38: *
39: *
40: **/
41:
42: public interface ScheduleElement extends TimeSpan {
43:
44: /** Start date is a millisecond-precision, inclusive time of start.
45: * @return Date Start time for the task
46: **/
47: Date getStartDate();
48:
49: /** End Date is millisecond-precision, <em>exclusive</em> time of end.
50: * @return Date End time for the task
51: **/
52: Date getEndDate();
53:
54: /** is the Date on or after the start time and strictly before the end time?
55: * @return boolean whether the date is included in this time interval.
56: **/
57: boolean included(Date date);
58:
59: /** is the time on or after the start time and strictly before the end time?
60: * @return boolean whether the time is included in this time interval
61: **/
62: boolean included(long time);
63:
64: /** Does the scheduleelement overlap (not merely abut) the schedule?
65: * @return boolean whether schedules overlap
66: **/
67: boolean overlapSchedule(ScheduleElement scheduleelement);
68:
69: /** Does the scheduleElement meet/abut the schedule?
70: **/
71: boolean abutSchedule(ScheduleElement scheduleelement);
72:
73: }
|