Java tutorial
//package com.java2s; /******************************************************************************* * Copyright (c) 2006, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are 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: * IBM Corporation - initial API and implementation *******************************************************************************/ import java.util.*; public class Main { private static boolean isValidTagException(HashSet<?> tagExceptions, String buffer) { String tagName = getTagName(buffer); if (tagExceptions.contains(tagName)) { return true; } return false; } private static String getTagName(String buffer) { StringBuffer tagName = new StringBuffer(); // The tag name is every non-whitespace character in the buffer until // a whitespace character is encountered for (int i = 0; i < buffer.length(); i++) { char character = buffer.charAt(i); if (Character.isWhitespace(character)) { break; } tagName.append(character); } return tagName.toString(); } }