Java Iterator from getEnumeratedObjectCount(Iterator objects)

Here you can find the source of getEnumeratedObjectCount(Iterator objects)

Description

Gets the enumerated object count.

License

Open Source License

Parameter

Parameter Description
T the generic type
objects The objects.

Return

Count of objects in iterator.

Declaration

protected static <T> int getEnumeratedObjectCount(Iterator<T> objects) 

Method Source Code

//package com.java2s;

import java.util.Iterator;

public class Main {
    /**/* www. java  2s  .  c  o m*/
     * Gets the enumerated object count.
     * 
     * @param <T>
     *            the generic type
     * @param objects
     *            The objects.
     * @return Count of objects in iterator.
     */
    protected static <T> int getEnumeratedObjectCount(Iterator<T> objects) {
        int count = 0;
        while (objects != null && objects.hasNext()) {
            @SuppressWarnings("unused")
            Object obj = objects.next();
            count++;
        }
        return count;
    }
}

Related

  1. getAll(Iterator it)
  2. getAt(Iterator it, int pos)
  3. getCommaSeparatedValue(Iterator it)
  4. getDestinationType(ImageReadParam param, Iterator imageTypes)
  5. getEmptyIterator()
  6. getFirstChildrendIterator(List children)
  7. getIndexInIterator(Iterator iterator, int index)
  8. getIterable(final Iterator i)
  9. getIterator(final int[] p, final Object[] data)