Java List Compare compareLists(List list, List> listOfLists)

Here you can find the source of compareLists(List list, List> listOfLists)

Description

compare Lists

License

Open Source License

Declaration

private static <E> boolean compareLists(List<E> list, List<List<E>> listOfLists) 

Method Source Code

//package com.java2s;
/*//from w  ww. ja  v a2  s. co  m
 * ***** BEGIN LICENSE BLOCK *****
 * Zimbra Collaboration Suite Server
 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013, 2014, 2016 Synacor, Inc.
 *
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software Foundation,
 * version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License along with this program.
 * If not, see <https://www.gnu.org/licenses/>.
 * ***** END LICENSE BLOCK *****
 */

import java.util.List;

public class Main {
    private static <E> boolean compareLists(List<E> list, List<List<E>> listOfLists) {
        int i = 0;
        for (List<E> curList : listOfLists) {
            for (E item : curList) {
                if (!item.equals(list.get(i))) {
                    return false;
                }
                i++;
            }
        }
        return true;
    }
}

Related

  1. compareList(Object eObj, Object rObj)
  2. compareLists(Class type, List list1, List list2)
  3. compareLists(final List list1, final List list2)
  4. compareLists(List strings1, List strings2, boolean ignoreCase)
  5. compareLists(List l1, List l2)
  6. compareLists(List a, List b)
  7. compareLists(List a, List b)
  8. compareLists(List list1, List list2)
  9. compareLists(Object obj1, Object obj2)