edu.princeton.cs.algs4.growingtree.framework
Interface NodeShape

All Superinterfaces:
java.awt.Shape
All Known Implementing Classes:
Ellipse2DNode

public interface NodeShape
extends java.awt.Shape

The NodeShape interface extends Shape for it is a specific type of shape that can be used as a node in addition to the regular shape methods.

For usage as a node in a tree, the NodeShape must implement the ability to get an Inscribed Rectangle, which is the only additional method this interface requires.

The interface is only valid for Binary trees, where only a single inscribedRectangle is required.

Version:
1.1 9/15/01
Author:
Corey Sanders
See Also:
Ellipse2DNode

Method Summary
 java.awt.geom.Rectangle2D getInscribedRectangle()
          Gets the Inscribed Rectangle of the current NodeShape.
 
Methods inherited from interface java.awt.Shape
contains, contains, contains, contains, getBounds, getBounds2D, getPathIterator, getPathIterator, intersects, intersects
 

Method Detail

getInscribedRectangle

java.awt.geom.Rectangle2D getInscribedRectangle()
Gets the Inscribed Rectangle of the current NodeShape. The Rectangle is for a single key.

Returns:
Rectangle2D that represents the inscribed rectangle.