Counts the number of elements contained in the specified enumeration.

This function works as follows:

int counter = 0;
while (e.hasMoreElements()) {
  counter ++;
  e.nextElement();
}
return counter;