Algorithm
Development Kit 1.0

algs.model.problems.segmentIntersection
Class EventQueue

java.lang.Object
  extended by algs.model.problems.segmentIntersection.EventQueue

public class EventQueue
extends java.lang.Object

The EventQueue for a horizontal-sweep line algorithm for line segment intersection.

The EventQueue must not be a heap-based implementation, since we will be called upon to test if an EventPoint is already within the Queue.

Since:
1.0
Version:
1.0, 6/15/08
Author:
George Heineman

Constructor Summary
EventQueue()
          Default constructor.
 
Method Summary
 boolean contains(EventPoint ep)
          Determine whether event point already exists within the queue.
 EventPoint event(EventPoint ep)
          Determine whether event point already exists within the queue, and return the actual event point within the queue if it does.
 void insert(EventPoint ep)
          Insert the Event Point into the queue, taking care to properly maintain the set of segments associated with this EventPoint if it is indeed has upper Segments.
 boolean isEmpty()
          Return whether the event queue is empty.
 EventPoint min()
          Remove and return left-most child [the smallest one].
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventQueue

public EventQueue()
Default constructor.

Method Detail

isEmpty

public boolean isEmpty()
Return whether the event queue is empty.


insert

public void insert(EventPoint ep)
Insert the Event Point into the queue, taking care to properly maintain the set of segments associated with this EventPoint if it is indeed has upper Segments.


min

public EventPoint min()
Remove and return left-most child [the smallest one].


contains

public boolean contains(EventPoint ep)
Determine whether event point already exists within the queue.

Parameters:
ep - event point to probe for

event

public EventPoint event(EventPoint ep)
Determine whether event point already exists within the queue, and return the actual event point within the queue if it does.

Parameters:
ep -

Algorithm Development Kit 1.0

This code supports the Algorithms in a Nutshell book, published by O'Reilly Media, Inc. in November 2008. Please visit the book web page to learn of any changes to the code repository or to record a potential defect.