com.sun.electric.database.geometry
Class PolyQTree.PolyNode

java.lang.Object
  extended by java.awt.geom.Area
      extended by com.sun.electric.database.geometry.PolyQTree.PolyNode
All Implemented Interfaces:
PolyNodeMerge, java.awt.Shape, java.lang.Cloneable, java.lang.Comparable<PolyQTree.PolyNode>
Enclosing class:
PolyQTree

public static class PolyQTree.PolyNode
extends java.awt.geom.Area
implements java.lang.Comparable<PolyQTree.PolyNode>, PolyNodeMerge

Class to define a node in a Quad Tree of polygons.


Constructor Summary
PolyQTree.PolyNode(java.awt.Shape shape)
           
 
Method Summary
 int compareTo(PolyQTree.PolyNode n1)
          Compare objects based on area.
 boolean doesTouch(java.awt.geom.PathIterator opi)
           
 boolean equals(java.lang.Object obj)
           
 double getArea()
          Calculates area
 double getMaxLength()
          Method to calculate longest edge.
 double getPerimeter()
           
 java.awt.geom.Point2D[] getPoints(boolean includeInitialPoint)
           
 PolyBase getPolygon()
          Method to get the polygon object.
 java.util.List getSortedLoops()
          Sort list of objects based on area
 int hasCode()
          Not to violate that equal objects must have equal hashcodes.
 boolean intersects(java.awt.geom.Area a)
          Overwriting original for Area to consider touching polygons
 java.lang.String toString()
          Returns a printable version of this PolyNode.
 
Methods inherited from class java.awt.geom.Area
add, clone, contains, contains, contains, contains, createTransformedArea, equals, exclusiveOr, getBounds, getBounds2D, getPathIterator, getPathIterator, intersect, intersects, intersects, isEmpty, isPolygonal, isRectangular, isSingular, reset, subtract, transform
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.electric.database.geometry.PolyNodeMerge
getBounds2D
 

Constructor Detail

PolyQTree.PolyNode

public PolyQTree.PolyNode(java.awt.Shape shape)
Method Detail

compareTo

public int compareTo(PolyQTree.PolyNode n1)
Compare objects based on area. This method doesn't guarantee (compare(x, y)==0) == (x.equals(y)) because x.equals relies on Area.equals()

Specified by:
compareTo in interface java.lang.Comparable<PolyQTree.PolyNode>
Returns:
Returns a negative integer, zero, or a positive integer as the first object has smaller than, equal to, or greater area than the second.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getPolygon

public PolyBase getPolygon()
Description copied from interface: PolyNodeMerge
Method to get the polygon object.

Specified by:
getPolygon in interface PolyNodeMerge
Returns:
a PolyBase object.

hasCode

public int hasCode()
Not to violate that equal objects must have equal hashcodes.


getMaxLength

public double getMaxLength()
Method to calculate longest edge.

Returns:
the length of the longest edge in this PolyQTree.

getPoints

public java.awt.geom.Point2D[] getPoints(boolean includeInitialPoint)
Parameters:
includeInitialPoint -

getPerimeter

public double getPerimeter()

doesTouch

public boolean doesTouch(java.awt.geom.PathIterator opi)

getArea

public double getArea()
Calculates area

Returns:
area associated to the node

toString

public java.lang.String toString()
Returns a printable version of this PolyNode.

Overrides:
toString in class java.lang.Object
Returns:
a printable version of this PolyNode.

intersects

public boolean intersects(java.awt.geom.Area a)
Overwriting original for Area to consider touching polygons


getSortedLoops

public java.util.List getSortedLoops()
Sort list of objects based on area