I have a class which is basically wrapper around a Map (that also holds some business logic obviously). What I would like to be able to do is this:
for(Object o: instanceOfMyClass) { ... }
So I want to loop over the values of the Map inside my class. Which interfaces do I need to implement in my class (Iterator, Iterable, ...)? I guess in the interface to implement I somehow need to return an Interator; how can I "reuse" the iterator for the Map (through Map.entrySet()) keeping in mind that I only want to have the values exposed in the iterator of my class?
Thanks a lot!