cs252proj.api
Interface RectangleIntersector
- public interface RectangleIntersector
An interface for determining which rectangles in a collection intersect
a given rectangle.
Method Summary |
void |
execute(jdsl.core.api.ObjectIterator oi)
Initializes the RectangleIntersector with the given set of
Rectangle2Ds. |
jdsl.core.api.ObjectIterator |
getIntersected(jdsl.geomobj.api.Rectangle2D rect)
Finds rectangles that intersect the given rectangle. |
execute
public void execute(jdsl.core.api.ObjectIterator oi)
throws java.lang.ClassCastException
- Initializes the RectangleIntersector with the given set of
Rectangle2Ds.
- Parameters:
oi
- an iterator over the set of Rectangle2Ds.- Throws:
java.lang.ClassCastException
- if an object in the iterator is not a
Rectangle2D.
getIntersected
public jdsl.core.api.ObjectIterator getIntersected(jdsl.geomobj.api.Rectangle2D rect)
throws java.lang.IllegalStateException
- Finds rectangles that intersect the given rectangle.
Rectangles sharing only a point or edge are not considered
intersecting.
- Parameters:
rect
- the query rectangle.- Returns:
- an iterator over the set of intersected rectangles.
- Throws:
java.lang.IllegalStateException
- if execute() was not called first.