Here you can find the source of searchInElement(String name, Map
Parameter | Description |
---|---|
name | Name |
elementMap | Map of css attributes |
public static boolean searchInElement(String name, Map<String, ArrayList<String>> elementMap)
//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; } }