Java Iterator countIterator(Iterator it)

Here you can find the source of countIterator(Iterator it)

Description

count Iterator

License

Open Source License

Declaration

public static int countIterator(Iterator<?> it) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Iterator;

public class Main {
    public static int countIterator(Iterator<?> it) {
        int x = 0;
        while (it.hasNext()) {
            it.next();/*from   w w w .j a v  a  2  s .  c om*/
            x++;
        }
        return x;
    }
}

Related

  1. copy(Iterator iterator)
  2. copyIterator(Iterable iterable)
  3. copyIterator(Iterator iter)
  4. copyOf(Iterator elements)
  5. count(Iterator thingsToCount)
  6. createMap(Iterator iter)
  7. createPathIterator(String path)
  8. createSkipIterator(Iterable source, int count)
  9. dump(Iterator it)