Java List Equal equals(List c1, List c2)

Here you can find the source of equals(List c1, List c2)

Description

equals

License

Open Source License

Declaration

public static boolean equals(List c1, List c2) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {

    public static boolean equals(List c1, List c2) {
        boolean bool = true;
        if (null != c1 && null != c2) {
            if (c1.size() != c2.size())
                bool = false;/*from w w  w.jav a  2s .co m*/
            else
                for (int i = 0; i < c1.size(); i++) {
                    if (!c1.get(i).getClass().equals(c2.get(i).getClass())) {
                        bool = false;
                        break;
                    } else if (!c1.get(i).equals(c2.get(i))) {
                        bool = false;
                        break;
                    }
                }
        } else {
            bool = false;
        }
        return bool;
    }
}

Related

  1. equalLists(List list1, List list2)
  2. equalLists(List one, List two)
  3. equalLists(List a, List b)
  4. equals(final List fromList, final List key, final int start)
  5. equals(List A, List B)
  6. equals(List list1, List list2)
  7. equals(List lst1, List lst2)
  8. equals(List l1, List l2)
  9. equals(List list, Object o)