Here you can find the source of equals(final List
Parameter | Description |
---|---|
fromList | From list. |
key | Key. |
start | Start index. |
public static final <T> boolean equals(final List<T> fromList, final List<T> key, final int start)
//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; } }