searching collections

 

■ For Sets use myset.contains(Obj)
Returns boolean.

 

■ For Maps use mymap.containsKey(Obj)

mymap.containsValue(Obj)
Both return boolean.

 

■ For Lists, use mylist.indexOf(Obj)
Returns index of found Object or 1 if not found.

 

■ For Vectors use myvector.contains(Obj) or

myvector.containsAll(coll)