Java ArrayList Search searchInElement(String name, Map> elementMap)

Here you can find the source of searchInElement(String name, Map> elementMap)

Description

Method for search string into css attributes

License

Open Source License

Parameter

Parameter Description
name Name
elementMap Map of css attributes

Return

true - find, or else - don't find

Declaration

public static boolean searchInElement(String name, Map<String, ArrayList<String>> elementMap) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
 * Distributed under license by Red Hat, Inc. All rights reserved.
 * This program is made available under the terms of the
 * Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:/*from w  w  w.j  a  v a2 s  .  c o  m*/
 *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
 ******************************************************************************/

import java.util.ArrayList;

import java.util.Map;
import java.util.Set;

public class Main {
    /**
     * Method for search string into css attributes
     *
     * @param name Name
     * @param elementMap Map of css attributes
     * @return true - find, or else - don't find
     */
    public static boolean searchInElement(String name, Map<String, ArrayList<String>> elementMap) {

        Set<String> set = elementMap.keySet();

        for (String str : set) {
            ArrayList<String> list = elementMap.get(str);
            if (list.contains(name.toLowerCase())) {
                return true;
            }
        }

        return false;
    }
}

Related

  1. search(ArrayList src, ArrayList pattern, int start)
  2. search(String token, ArrayList iniTokens)
  3. searchString(String name, ArrayList input)