Java Iterator areEqual(final Iterator a, final Iterator b)

Here you can find the source of areEqual(final Iterator a, final Iterator b)

Description

are Equal

License

Apache License

Declaration

public static boolean areEqual(final Iterator a, final Iterator b) 

Method Source Code

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

import java.util.Iterator;

public class Main {
    public static boolean areEqual(final Iterator a, final Iterator b) {
        while (a.hasNext() || b.hasNext()) {
            if (a.hasNext() != b.hasNext())
                return false;
            if (!a.next().equals(b.next()))
                return false;
        }//from   ww  w .  j  a  v  a 2s  . co m
        return true;
    }
}

Related

  1. addAllFromIterator( COLL dest, Iterator source)
  2. addAllToList(Iterator i)
  3. addAllToSet(Set set, Iterator it)
  4. addTo(final Iterator iter, final C c)
  5. appendTo(final Iterator iter, final List list)
  6. areEqual(final Iterator ittyA, final Iterator ittyB)
  7. asArray(T[] arr, Iterator itr)
  8. asList(final Iterator iterator)
  9. asList(Iterator it)