Java Iterator equalsIterator(Iterator it, Iterator it2)

Here you can find the source of equalsIterator(Iterator it, Iterator it2)

Description

equals Iterator

License

Open Source License

Declaration

public static boolean equalsIterator(Iterator<?> it, Iterator<?> it2) 

Method Source Code


//package com.java2s;
/*//from  w  ww  .  j  a v  a2  s . c  o  m
 * Copyright (c) 2006 Rick Mugridge, www.RimuResearch.com
 * Released under the terms of the GNU General Public License version 2 or later.
 * Written: 5/09/2006
 */

import java.util.Iterator;

public class Main {
    public static boolean equalsIterator(Iterator<?> it, Iterator<?> it2) {
        if (it == it2)
            return true;
        while (it.hasNext() && it2.hasNext()) {
            if (!it.next().equals(it2.next()))
                return false;
        }
        return !it.hasNext() && !it2.hasNext();
    }
}

Related

  1. createMap(Iterator iter)
  2. createPathIterator(String path)
  3. createSkipIterator(Iterable source, int count)
  4. dump(Iterator it)
  5. endOfData(Iterator inputIter, Iterator resultIter)
  6. fill(final Iterator iterator, final S collection)
  7. fillArray(Iterator ii, Object[] fillMe, boolean null_terminate)
  8. fillCollection(final Iterator iterator, final Collection collection)
  9. fillCollection(final Iterator iterator, final Collection collection)