Skip to content

PunctuationQueue

Creating Instance

PunctuationQueue takes no arguments to be created.

PunctuationQueue is created along with a StreamTask.

PunctuationSchedules

PunctuationQueue creates a PriorityQueue (Java) of PunctuationSchedules.

A new PunctuationSchedule is added in schedule.

Scheduling PunctuationSchedule

Cancellable schedule(
  PunctuationSchedule sched)

schedule adds the given PunctuationSchedule to the PunctuationSchedules.

schedule is used when:

mayPunctuate

boolean mayPunctuate(
  long timestamp,
  PunctuationType type,
  ProcessorNodePunctuator processorNodePunctuator)

mayPunctuate returns true when one or more punctuators were executed.


mayPunctuate takes a peek at the first PunctuationSchedule in the PriorityQueue (with order by timestamp).

mayPunctuate goes over the PunctuationSchedules in the PriorityQueue until there are no more PunctuationSchedules or their timestamp is after the given timestamp (in a while loop).

If the timestamp of the PunctuationSchedule is below or equal to the given timestamp, mayPunctuate takes it out (and removes) from the PriorityQueue.

If the PunctuationSchedule is not cancelled, mayPunctuate requests the given ProcessorNodePunctuator to punctuate.

Only when the PunctuationSchedule was not cancelled when the punctuator was executed, mayPunctuate requests the PunctuationSchedule for next PunctuationSchedule (for the given current timestamp) and adds it to the PriorityQueue.

mayPunctuate takes a peek again at the (next) first PunctuationSchedule in the PriorityQueue and starts (the loop) again.

mayPunctuate is used when:

Back to top