Re: Simpler way to filter



On 05/09/2008 16:23, laredotornado allegedly wrote:
Hi,

I'm using Java 1.5. I have a Vector of objects,

*BZZT*. The only possible reason you could justifiably use a java.util.Vector would be if you coded with a JSE version prior to 1.2.

all of type
"MyProperty". What I want is to filter the vector and keep the
elements whose "MyProperty.getName.equals(someString)". Is there any
easier way of doing this rather than iterating over the Vector,
looking at each element, then adding that element to the new, filtered
vector depending on whether it has met the conditions?

No.

Removing elements is slower in every but the most trivial cases.

--
DF.
.