Is it OK to use sun.awt.geom.Curve methods?

Hi,

I’ve made my own high-performance 2D polygon class that extends Shape and to find out if a point is contained within it I use the sun.awt.geom.Curve method:

public static int crossingsForPath(PathIterator pi, double x, double y) . You can see the Curve class at:

http://jsourcery.com/output/sun/j2se/j2sdk/1.4.2_04/sun/awt/geom/Curve.html

I only found that this class existed when using the profiler (-Xprof). Is it OK to directly reference this method in my own code or is it not platform-portable??? Why can’t it be found in the API documentation?

Thanks,
Keith

Its an internal implementation class and hence not safe to use since it could change from version to version of VM.

Kev

Thanks Kev, In that case I’ll just cut and paste those Curve methods into my own class.

Keith

This is not allowed at all, it’s SUN’s source and well, simply take it wont make it :wink:

lg Clemens

Damned if you do, damned if you don’t.