001/**
002 * Copyright (c) 2001, Sergey A. Samokhodkin
003 * All rights reserved.
004 * <p>
005 * Redistribution and use in source and binary forms, with or without modification,
006 * are permitted provided that the following conditions are met:
007 * <p>
008 * - Redistributions of source code must retain the above copyright notice,
009 * this list of conditions and the following disclaimer.
010 * - Redistributions in binary form
011 * must reproduce the above copyright notice, this list of conditions and the following
012 * disclaimer in the documentation and/or other materials provided with the distribution.
013 * - Neither the name of jregex nor the names of its contributors may be used
014 * to endorse or promote products derived from this software without specific prior
015 * written permission.
016 * <p>
017 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
018 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
019 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
020 * IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
021 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
022 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
023 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
024 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
025 * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
026 *
027 * @version 1.2_01
028 */
029
030package regexodus;
031
032public interface MatchResult {
033    int MATCH = 0;
034    int PREFIX = -1;
035    int SUFFIX = -2;
036    int TARGET = -3;
037
038    Pattern pattern();
039
040    int groupCount();
041
042    boolean isCaptured();
043
044    boolean isCaptured(int groupId);
045
046    boolean isCaptured(String groupName);
047
048    String group(int n);
049
050    boolean getGroup(int n, StringBuilder sb);
051
052    boolean getGroup(int n, TextBuffer tb);
053
054    String group(String name);
055
056    boolean getGroup(String name, StringBuilder sb);
057
058    boolean getGroup(String name, TextBuffer tb);
059
060    String prefix();
061
062    String suffix();
063
064    String target();
065
066    int targetStart();
067
068    int targetEnd();
069
070    char[] targetChars();
071
072    int start();
073
074    int end();
075
076    int length();
077
078    int start(int n);
079
080    int end(int n);
081
082    int length(int n);
083
084    char charAt(int i);
085
086    char charAt(int i, int groupNo);
087}