Java List Compare compareTwoListOfStrings(List first, List second)

Here you can find the source of compareTwoListOfStrings(List first, List second)

Description

compare Two List Of Strings

License

Open Source License

Declaration

public static boolean compareTwoListOfStrings(List<String> first, List<String> second) 

Method Source Code

//package com.java2s;
/*/*from w  w w.j  a  va2s .c o m*/
 * CollectionUtil.java
 * Copyright (c) 2014, CODEROAD, All Rights Reserved.
 *
 * This software is the confidential and proprietary information of CODEROAD
 * ("Confidential Information"). You shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement you entered into with
 * CODEROAD.
 */

import java.util.List;

public class Main {
    public static boolean compareTwoListOfStrings(List<String> first, List<String> second) {
        boolean result = false;
        int contCompare = 0;
        for (int i = 0; i < first.size(); i++) {
            String data = first.get(i);
            if (data.equals(second.get(i))) {
                contCompare++;
            }
        }

        if (contCompare == first.size()) {
            result = true;
        }
        return result;
    }
}

Related

  1. compareStringList(List list1, List list2)
  2. compareStringLists(List elements1, List elements2)
  3. compareSubstring(List pieces, String s)
  4. compareTermList(final List tl0, final List tl1)
  5. compareTo(List list, int i, int j)
  6. compareVectors(List vectorA, List vectorB)
  7. equalsToAny(Object comparable, Object... compareList)
  8. parseAndCompare(List fileNames, int masterPartitionId)
  9. sortList(List sources, Comparator comparer)