Package jsl.calendar
Interface CalendarIfc
-
- All Known Implementing Classes:
LinkedListEventCalendar
,PriorityQueueEventCalendar
,SkewHeapEventCalendar
,TreeSetEventCalendar
public interface CalendarIfc
The interface defines behavior for holding, adding and retrieving JSLEvents.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(JSLEvent event)
The add method will place the provided JSLEvent into the underlying data structure ensuring the ordering of the events to be processedvoid
cancel(JSLEvent event)
Cancels the supplied JSLEvent in the calendar.void
clear()
Clears or cancels every event in the data structure.boolean
isEmpty()
Checks to see if the calendar is emptyJSLEvent
nextEvent()
Returns the next JSLEvent to be executed.JSLEvent
peekNext()
Peeks at the next event without removing itint
size()
Returns the number of events in the calendar
-
-
-
Method Detail
-
add
void add(JSLEvent event)
The add method will place the provided JSLEvent into the underlying data structure ensuring the ordering of the events to be processed- Parameters:
event
- The JSLEvent to be added to the calendar
-
nextEvent
JSLEvent nextEvent()
Returns the next JSLEvent to be executed. The event is removed from the calendar if it exists- Returns:
- The JSLEvent to be executed next
-
peekNext
JSLEvent peekNext()
Peeks at the next event without removing it- Returns:
-
isEmpty
boolean isEmpty()
Checks to see if the calendar is empty- Returns:
- true is empty, false is not empty
-
clear
void clear()
Clears or cancels every event in the data structure. Removes all JSLEvents from the data structure.
-
cancel
void cancel(JSLEvent event)
Cancels the supplied JSLEvent in the calendar. Canceling does not remove the event from the data structure. It simply indicates that the scheduled event must not be executed.- Parameters:
event
- The JSLEvent to be canceled
-
size
int size()
Returns the number of events in the calendar- Returns:
- An int representing the number of events.
-
-