In Java it is common to use an enumeration
as the means to iterate through the objects in a container.
In Python we can define an enumeration like this:
class Enumeration(Object):
def hasMoreElements():
pass
hasMoreElements = abstractmethod(hasMoreElements)
def nextElement():
pass
nextElement = abstractmethod(nextElement)
Given an enumeration e from some container c,
the contents of c can be printed like this:
while (e.hasMoreElements()):
print e.nextElement()
Devise a wrapper class to encapsulate a Python iterator
and provide the functionality of a Java enumeration.