MatchPattern.java revision 8f8adeb1540d89588dba4c26d00a6ed6887cf6de
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * The contents of this file are subject to the terms
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * of the Common Development and Distribution License
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * (the License). You may not use this file except in
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * compliance with the License.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * You can obtain a copy of the License at
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * https://opensso.dev.java.net/public/CDDLv1.0.html or
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * See the License for the specific language governing
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * permission and limitations under the License.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * When distributing Covered Code, include this CDDL
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Header Notice in each file and include the License file
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * If applicable, add the following below the CDDL Header,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * with the fields enclosed by brackets [] replaced by
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * your own identifying information:
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * "Portions Copyrighted [year] [name of copyright owner]"
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * $Id: MatchPattern.java,v 1.2 2008/06/25 05:51:29 qcheng Exp $
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Portions Copyrighted 2014 ForgeRock AS.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Portions Copyrighted 2014 Nomura Research Institute, Ltd.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncpublic class MatchPattern {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync public MatchPattern(String pattern, int matchType) {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync boolean matchFound = false;
if (isMatchFromStart()) {
} else if (isMatchFromEnd()) {
} else if (isIgnoreCase()) {
matchFound = true;
matchFound = true;
return matchFound;
public boolean isMatchForLastOccurranceInFile() {
return lastOccurranceInFile;
public boolean isActive() {
return isActive;
return pattern;
public int getMatchType() {
return matchType;
private boolean isMatchFromStart() {
private boolean isMatchFromEnd() {
private boolean isIgnoreCase() {
return ignoreCase;
private boolean isActive;
private boolean lastOccurranceInFile;
private boolean ignoreCase;
private int matchType;