From: Samuele P. <ped...@bl...> - 2002-01-18 16:27:53
|
[Eric E. Allen] > The Enumeration interface includes a hasMoreElements() method, but not a > hasNextElement(). > As to why hasNext() works: my guess is that the > implementation of Enumeration returned by the Hashtable also supports the > (preferred) Iterator interface. > This is also true at least with sun jdk, (one can check the source of the library classes :)). The point here to note is that jython give you access to all the methods of the concrete class of a Java object (inclusive all superclasses methods), it is not that in case a Java method returns an Enumeration on Jython side the returned object will offer that limited view of its concrete behavior. regards, Samuele Pedroni. |