01: /**
02: * Copyright (c) 2001, Sergey A. Samokhodkin
03: * All rights reserved.
04: *
05: * Redistribution and use in source and binary forms, with or without modification,
06: * are permitted provided that the following conditions are met:
07: *
08: * - Redistributions of source code must retain the above copyright notice,
09: * this list of conditions and the following disclaimer.
10: * - Redistributions in binary form
11: * must reproduce the above copyright notice, this list of conditions and the following
12: * disclaimer in the documentation and/or other materials provided with the distribution.
13: * - Neither the name of jregex nor the names of its contributors may be used
14: * to endorse or promote products derived from this software without specific prior
15: * written permission.
16: *
17: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
18: * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20: * IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
21: * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23: * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
25: * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26: *
27: * @version 1.2_01
28: */package jregex;
29:
30: import java.io.*;
31:
32: public interface MatchResult {
33: public int MATCH = 0;
34: public int PREFIX = -1;
35: public int SUFFIX = -2;
36: public int TARGET = -3;
37:
38: public Pattern pattern();
39:
40: public int groupCount();
41:
42: public boolean isCaptured();
43:
44: public boolean isCaptured(int groupId);
45:
46: public boolean isCaptured(String groupName);
47:
48: public String group(int n);
49:
50: public boolean getGroup(int n, StringBuffer sb);
51:
52: public boolean getGroup(int n, TextBuffer tb);
53:
54: public String group(String name);
55:
56: public boolean getGroup(String name, StringBuffer sb);
57:
58: public boolean getGroup(String name, TextBuffer tb);
59:
60: public String prefix();
61:
62: public String suffix();
63:
64: public String target();
65:
66: public int targetStart();
67:
68: public int targetEnd();
69:
70: public char[] targetChars();
71:
72: public int start();
73:
74: public int end();
75:
76: public int length();
77:
78: public int start(int n);
79:
80: public int end(int n);
81:
82: public int length(int n);
83:
84: public char charAt(int i);
85:
86: public char charAt(int i, int groupNo);
87: }
|