Java ListIterator Usage listHasIdentContent(List list_1, List list_2)

Here you can find the source of listHasIdentContent(List list_1, List list_2)

Description

list Has Ident Content

License

Apache License

Declaration

@SuppressWarnings("rawtypes")
    public static boolean listHasIdentContent(List list_1, List list_2) 

Method Source Code

//package com.java2s;
/************************************************************************
 * Copyright (c) 2014 IoT-Solutions e.U.
 * //from  www . j a v  a  2  s.c  om
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *  http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ************************************************************************/

import java.util.List;
import java.util.ListIterator;

public class Main {
    @SuppressWarnings("rawtypes")
    public static boolean listHasIdentContent(List list_1, List list_2) {
        if (list_1 == list_2)
            return true;
        if (list_1.size() != list_2.size())
            return false;

        ListIterator<?> e1 = list_1.listIterator();
        ListIterator<?> e2 = list_2.listIterator();
        while (e1.hasNext() && e2.hasNext()) {
            Object o1 = e1.next();
            Object o2 = e2.next();
            if (o1 != o2)
                return false;
        }
        return true;
    }
}

Related

  1. internStringsInList(List list)
  2. isEqual(java.util.List list1, java.util.List list2)
  3. iteratorBinarySearchGet(ListIterator i, int index)
  4. lastIndexOf(List list, T element)
  5. listEquals(List left, List right)
  6. listToStringArray(java.util.List list)
  7. makeSortFieldFallbackExpr(List fieldNames)
  8. normalizeVersion(String version, int length)
  9. numberToDigits(int num)