Java Iterator size(Iterator iterator)

Here you can find the source of size(Iterator iterator)

Description

size

License

Open Source License

Declaration

public static int size(Iterator iterator) 

Method Source Code


//package com.java2s;
import java.util.*;

public class Main {
    public static int size(Iterator iterator) {
        int count = 0;
        while (iterator.hasNext()) {
            iterator.next();// w ww .jav a2  s  .  com
            count++;
        }
        return count;
    }
}

Related

  1. singleOrDefault(Iterator iterator)
  2. singletonIterator(final Object item)
  3. singletonIterator(final T item)
  4. singletonIterator(final T nullableValue)
  5. singletonIterator(final T t)
  6. splice(LinkedList list, Iterator iterator, LinkedList list2, V v)
  7. toArray(final Iterator iterator)
  8. toCollection(final Iterator iterator, final Collection c)
  9. toCommaSeparatedString(Iterator i)