On Fri, 16 Nov 2001 10:36:02 -0700, Carlos Ariza <[EMAIL PROTECTED]> wrote:
>Vector3d vector = new Vector3d();
>Point3d[] El = new Point3d[]{Pnt,Pnt1};
>vector .addElement(El);
>
>Point3d[] El1 = new Point3d[]{Pnt,Pnt1};
>
>I need to obtain true if El1 = El, can anyone suggest the way ?
>
>vector.contains(El1) is false.
>
>
>Thanks in advance
Well, if you are indeed interested in storing arrays in the Vector, consider
using List collection ( ArrayList, and in fact Vector itself ) instead
of arrays. The List subclasses override the "equals" method of Object.
Indeed they override the hashcode also sensibly - the hashcode
of a List is a function of the hashcode of its elements. I dont recall
what the "contains" method of Vector does exactly, but potential speed ups
in terms of rejection tests could be achieved by first comparing
hashcodes....Just a thought...
Raj Vaidya
>
> ==========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff JAVA3D-INTEREST". For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".