If there any way we can call the method of an object inside a Hashset which in itself is a value in a Hashmap without making an iterator or a .forEach(lambda) or in any way going through each object sequentially?
Consider we have a Hashmap like this. Map<Boolean,Set<Place>> selectedMap
Consider Place extends JComponent and has a boolean value representing if the user had selected the object with the mouse, the map contains a set with all selected and all unselected objects.
If we for example want to call the remove
-method of all selected objects, is there a way of doing that in the manner outlined above?