Java Utililty Methods ArrayList Search

List of utility methods to do ArrayList Search

Description

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

Method

intsearch(ArrayList src, ArrayList pattern, int start)
Searches an ArrayList of Strings starting from a specific position for a pattern
int index = -1;
int pos = -1;
int startpos = 0;
if (start > src.size() - pattern.size()) {
    return -1;
do {
    pos = src.subList(startpos + start, src.size() - pattern.size() + 1).indexOf(pattern.get(0));
...
Stringsearch(String token, ArrayList iniTokens)
Search for the value of a key in a tokenized ini file
String pToken = "";
for (byte[] iniTokenBytes : iniTokens) {
    String curToken = new String(iniTokenBytes);
    if (curToken.equals(token)) {
        pToken = curToken;
    } else if (pToken.equals(token)) {
        if (curToken.equals("=")) {
            pToken = curToken;
...
booleansearchInElement(String name, Map> elementMap)
Method for search string into css attributes
Set<String> set = elementMap.keySet();
for (String str : set) {
    ArrayList<String> list = elementMap.get(str);
    if (list.contains(name.toLowerCase())) {
        return true;
return false;
...
StringsearchString(String name, ArrayList input)
This method searchs for a String withing an ArrayList containing strings.
boolean found = false;
int i = 0;
while ((found == false) && (i < input.size())) {
    if (((String) input.get(i)).equals(name)) {
        found = true;
    } else {
        i++;
if (found) {
    return ((String) input.get(i));
} else {
    return (null);