Java ListIterator Usage isEqual(java.util.List list1, java.util.List list2)

Here you can find the source of isEqual(java.util.List list1, java.util.List list2)

Description

is Equal

License

Apache License

Declaration

public static boolean isEqual(java.util.List list1, java.util.List list2) 

Method Source Code

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

import java.util.ListIterator;

public class Main {
    public static boolean isEqual(java.util.List list1, java.util.List list2) {
        ListIterator e1 = list1.listIterator();
        ListIterator e2 = list2.listIterator();
        while (e1.hasNext() && e2.hasNext()) {
            Object o1 = e1.next();
            Object o2 = e2.next();
            if (!(o1 == null ? o2 == null : o1.equals(o2)))
                return false;
        }//from w w  w  .j  a v  a  2  s.  c o m
        return !(e1.hasNext() || e2.hasNext());
    }
}

Related

  1. incrementalComponentWiseAverageArbitraryDepth(Object average, int n, Object newItems)
  2. indexOf(List list, E object)
  3. insertBefore(List list, E... elements)
  4. intern(ListIterator in)
  5. internStringsInList(List list)
  6. iteratorBinarySearchGet(ListIterator i, int index)
  7. lastIndexOf(List list, T element)
  8. listEquals(List left, List right)
  9. listHasIdentContent(List list_1, List list_2)