searching through a vector

Hey,

Ive got a vector which contains bidders and If the user is not the leading bidder when disconnecting, their associated Bidder object needs to be removed from the server.

So i need to delete any bidders from the vector that dont equal the name ive got ( the leading bidder).... I was thinking an if statement but Im struggling with vectors and dont know if its possible to do such a simple thing... im going to keep searching and trying but any ideas would be great

Thanks

[501 byte] By [Karen_a] at [2007-11-27 0:36:04]
# 1
It sounds like what you want to use is the Collections retainAll method. Really, after the operation, you want the Vector to contain just ONE object (the one you have). So you call retainAll(leadingBidder), and it will discard the rest.- Adam
guitar_man_Fa at 2007-7-11 22:45:14 > top of Java-index,Java Essentials,New To Java...
# 2
> retainAll(leadingBidder) Sorry, that should bemyVector.retainAll(Collections.singletonList(leadingBidder));- Adam
guitar_man_Fa at 2007-7-11 22:45:14 > top of Java-index,Java Essentials,New To Java...
# 3
Hey, thanks Ill get on with trying that now! :-)
Karen_a at 2007-7-11 22:45:14 > top of Java-index,Java Essentials,New To Java...