cs252proj.api
Interface RectangleContourFinder


public interface RectangleContourFinder

An interface for finding the contour of a collection of Rectangle2Ds.


Method Summary
 void execute(jdsl.core.api.ObjectIterator oi)
          Initializes the RectangleContourFinder with the given collection of rectangles.
 jdsl.graph.api.InspectableGraph getContour()
           
 jdsl.core.api.ObjectIterator getCorrespRects(jdsl.graph.api.Edge e)
          Finds the rectangles in the original collection that correspond to the given edge in the contour.
 jdsl.core.api.ObjectIterator getCorrespRects(jdsl.graph.api.Vertex v)
          Finds the rectangles in the original collection that correspond to the given vertex in the contour.
 

Method Detail

execute

public void execute(jdsl.core.api.ObjectIterator oi)
             throws java.lang.ClassCastException
Initializes the RectangleContourFinder with the given collection of rectangles.
Parameters:
oi - an iterator over the collection of Rectangle2Ds.
Throws:
java.lang.ClassCastException - if the iterator contains objects that are not Rectangle2Ds.

getContour

public jdsl.graph.api.InspectableGraph getContour()
                                           throws java.lang.IllegalStateException
Returns:
a graph corresponding to the contour of the union of the rectangles, with Point2Ds stored at the vertices.
Throws:
java.lang.IllegalStateException - if execute() was not called first.

getCorrespRects

public jdsl.core.api.ObjectIterator getCorrespRects(jdsl.graph.api.Edge e)
                                             throws java.lang.IllegalArgumentException,
                                                    java.lang.IllegalStateException
Finds the rectangles in the original collection that correspond to the given edge in the contour.
Parameters:
e - the edge for which to search.
Returns:
an iterator over the collection of corresponding rectangles.
Throws:
java.lang.IllegalArgumentException - if e is not in the contour.
java.lang.IllegalStateException - if execute() was not called first.

getCorrespRects

public jdsl.core.api.ObjectIterator getCorrespRects(jdsl.graph.api.Vertex v)
                                             throws java.lang.IllegalArgumentException,
                                                    java.lang.IllegalStateException
Finds the rectangles in the original collection that correspond to the given vertex in the contour.
Parameters:
v - the vertex for which to search.
Returns:
an iterator over the collection of corresponding rectangles.
Throws:
java.lang.IllegalArgumentException - if v is not in the contour.
java.lang.IllegalStateException - if execute() was not called first.