I've never used Jython and can't really see why it would return all that, but I assume there's a good reason.
If you only wanted the count, wouldn't one of these work?:
myHash.size()
len(myHash)
If not, a simple method of counting the number of elements that an iterator will yield to you is this:
len([x for x in myHash.elements() ])
Basically you make it into a list and grab its length.
|