Java List Equal equals(final List fromList, final List key, final int start)

Here you can find the source of equals(final List fromList, final List key, final int start)

Description

equals

License

Open Source License

Parameter

Parameter Description
fromList From list.
key Key.
start Start index.

Return

true if the key appears in fromList at the given start index.

Declaration

public static final <T> boolean equals(final List<T> fromList, final List<T> key, final int start) 

Method Source Code

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

import java.util.List;

public class Main {
    /**/*from   ww w  .ja va 2s  .c om*/
     * @param fromList From list.
     * @param key Key.
     * @param start Start index.
     * 
     * @return true if the key appears in fromList at the given start index.
     */
    public static final <T> boolean equals(final List<T> fromList, final List<T> key, final int start) {
        boolean answer = false;

        if ((fromList != null) && (key != null)) {
            final int size = fromList.size();
            final int end = start + key.size();

            if ((0 <= start) && (end <= size)) {
                answer = key.equals(fromList.subList(start, end));
            }
        }

        return answer;
    }
}

Related

  1. equalLists(List aV1, List aV2)
  2. equalLists(List list1, List list2)
  3. equalLists(List list1, List list2)
  4. equalLists(List one, List two)
  5. equalLists(List a, List b)
  6. equals(List A, List B)
  7. equals(List c1, List c2)
  8. equals(List list1, List list2)
  9. equals(List lst1, List lst2)