public static long count ( Iterator < String > iterator ) { if ( iterator == null ) { return 0 ; } long count = 0 ; while ( iterator . hasNext ( ) ) { ++ count ; iterator . next ( ) ; } return count ; }
Determines the number of elements in an iteration .