-
Enhancement
-
Resolution: Fixed
-
P3
-
1.0
-
1.1
-
sparc
-
solaris_2.4
-
Not verified
[pgt, 1/16/1995]
The present interface to the Vector class does not provide a method
to reliably find an element in the Vector. So, I would like to propose
the following extension:
Object findElement( Object elem )
This could be implemented as:
int index = indexOf( elem ) ;
return index >= 0 ? elementAt( index ) : null ;
This needs to be a synchronized method, otherwise the code fragment contains
a race condition.
The present interface to the Vector class does not provide a method
to reliably find an element in the Vector. So, I would like to propose
the following extension:
Object findElement( Object elem )
This could be implemented as:
int index = indexOf( elem ) ;
return index >= 0 ? elementAt( index ) : null ;
This needs to be a synchronized method, otherwise the code fragment contains
a race condition.