Package jsl.calendar
Class LinkedListEventCalendar
- java.lang.Object
-
- jsl.calendar.LinkedListEventCalendar
-
- All Implemented Interfaces:
CalendarIfc
public class LinkedListEventCalendar extends java.lang.Object implements CalendarIfc
LinkedListEventCalendar is a concrete implementation of the CalendarIfc for use with the Scheduler This class provides an event calendar by using a java.util.LinkedList to hold the underlying events.
-
-
Constructor Summary
Constructors Constructor Description LinkedListEventCalendar()Creates new Calendar
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(JSLEvent e)The add method will place the provided JSLEvent into the underlying data structure ensuring the ordering of the events to be processedvoidcancel(JSLEvent e)Cancels the supplied JSLEvent in the calendar.voidclear()Clears or cancels every event in the data structure.booleanisEmpty()Checks to see if the calendar is emptyJSLEventnextEvent()Returns the next JSLEvent to be executed.JSLEventpeekNext()Peeks at the next event without removing itintsize()Returns the number of events in the calendarjava.lang.StringtoString()
-
-
-
Method Detail
-
add
public void add(JSLEvent e)
Description copied from interface:CalendarIfcThe add method will place the provided JSLEvent into the underlying data structure ensuring the ordering of the events to be processed- Specified by:
addin interfaceCalendarIfc- Parameters:
e- The JSLEvent to be added to the calendar
-
nextEvent
public JSLEvent nextEvent()
Description copied from interface:CalendarIfcReturns the next JSLEvent to be executed. The event is removed from the calendar if it exists- Specified by:
nextEventin interfaceCalendarIfc- Returns:
- The JSLEvent to be executed next
-
peekNext
public JSLEvent peekNext()
Description copied from interface:CalendarIfcPeeks at the next event without removing it- Specified by:
peekNextin interfaceCalendarIfc- Returns:
-
isEmpty
public boolean isEmpty()
Description copied from interface:CalendarIfcChecks to see if the calendar is empty- Specified by:
isEmptyin interfaceCalendarIfc- Returns:
- true is empty, false is not empty
-
clear
public void clear()
Description copied from interface:CalendarIfcClears or cancels every event in the data structure. Removes all JSLEvents from the data structure.- Specified by:
clearin interfaceCalendarIfc
-
cancel
public void cancel(JSLEvent e)
Description copied from interface:CalendarIfcCancels 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.- Specified by:
cancelin interfaceCalendarIfc- Parameters:
e- The JSLEvent to be canceled
-
size
public int size()
Description copied from interface:CalendarIfcReturns the number of events in the calendar- Specified by:
sizein interfaceCalendarIfc- Returns:
- An int representing the number of events.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-