openlr.map.utils
Class IteratorHelper

java.lang.Object
  extended by openlr.map.utils.IteratorHelper

public final class IteratorHelper
extends Object

The IteratorHelper provides helper methods for iterators.

OpenLR is a trade mark of TomTom International B.V.

email: software@openlr.org

Author:
TomTom International B.V.

Method Summary
static
<E> boolean
contains(Iterator<? extends E> iter, E item)
          Checks if an element item is contained in the iterator sequence.
static
<E> int
size(Iterator<E> iter)
          Returns the number of elements in the iterator sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

contains

public static <E> boolean contains(Iterator<? extends E> iter,
                                   E item)
Checks if an element item is contained in the iterator sequence. The iterator cannot be re-used after calling this function!!

Type Parameters:
E - the element type
Parameters:
iter - the iterator
item - the item
Returns:
true, if the element is in the iterator sequence

size

public static <E> int size(Iterator<E> iter)
Returns the number of elements in the iterator sequence. The iterator cannot be re-used after calling this function!!

Type Parameters:
E - the element type
Parameters:
iter - the iterator
Returns:
the number of elements


Copyright © 2013 TomTom International B.V.. All Rights Reserved.