Java Utililty Methods List Search

List of utility methods to do List Search

Description

The list of methods to do List Search are organized into topic(s).

Method

intsearch(List> collection, T element)
search
int index = 0;
for (Comparable<? super T> el : collection) {
    int cmp = el.compareTo(element);
    if (cmp == 0) {
        return index;
    index++;
return -1;
booleansearch(String[] searchList, String s)
search
if (null == s || null == searchList) {
    return false;
for (int i = 0; i < searchList.length; i++) {
    if (0 == searchList[i].compareTo(s)) {
        return true;
return false;
booleansearchReplace(String key, String value, List lines)
search Replace
return searchReplace(key, value, lines, false);