Java Iterator Size count(final Iterator iterator)

Here you can find the source of count(final Iterator iterator)

Description

count

License

Apache License

Declaration

public static final long count(final Iterator iterator) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Iterator;

public class Main {
    public static final long count(final Iterator iterator) {
        long ix = 0;
        for (; iterator.hasNext(); ++ix)
            iterator.next();//from ww w.j  a  va  2s .  c o m
        return ix;
    }
}

Related

  1. count(Iterator triples)
  2. count(Iterator iterator)
  3. count(Iterator it)
  4. counter(final Iterator iterator)