First of all, I'm going to assume you meant Vector, not Vector3d (which does
not have an addElement method).
El1 will never == El, the arrays are different object instances, and thus the
references will not be ==. However, you can make them .equal().
One way would be to wrap the arrays in another class, e.g.:
class PointArray
{
private Point3d[] _array;
PointArray(Point3d[] array)
{
_array = array;
}
public boolean
equals(Object o)
{
if (o instanceof PointArray) {
return Arrays.equals(_array, ((PointArray)o)._array);
} else {
return false;
}
}
};
See the documentation for java.util.Vector$contains(Object):
Returns:
true if and only if the specified object
is the same as a component in this vector,
as determined by the equals method; false otherwise.
Now your code could look like this:
Vector vector = new Vector();
PointArray El = new PointArray(new Point3d[]{Pnt,Pnt1});
vector.addElement(El);
PointArray El1 = new PointArray(new Point3d[]{Pnt,Pnt1});
vector.contains(El1) should now return true.
HTH
--
Dardo D. Kleiner
Connection Machine Facility, Center for Computational Sciences
Naval Research Laboratory (Washington, DC)
[EMAIL PROTECTED] -- 202.404.7019
===========================================================================
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".