01: /*
02: * Copyright 2004-2007 Gary Bentley
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may
05: * not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * Unless required by applicable law or agreed to in writing, software
10: * distributed under the License is distributed on an "AS IS" BASIS,
11: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: * See the License for the specific language governing permissions and
13: * limitations under the License.
14: */
15: package org.josql.functions;
16:
17: import java.io.File;
18:
19: /**
20: * This class represents the match of a String in a file.
21: */
22: public class FileMatch {
23:
24: private File f = null;
25: private int line = 0;
26: private int col = 0;
27: private String str = null;
28: private String oLine = null;
29:
30: public FileMatch(File f, int line, int col, String str, String oLine) {
31:
32: this .f = f;
33: this .line = line;
34: this .col = col;
35: this .str = str;
36: this .oLine = oLine;
37:
38: }
39:
40: public String toString() {
41:
42: return this .f.getPath() + "[" + this .line + "," + this .col
43: + "] \"" + this .str + "\" " + this .oLine;
44:
45: }
46:
47: public String getOriginalLine() {
48:
49: return this .oLine;
50:
51: }
52:
53: public String getString() {
54:
55: return this .str;
56:
57: }
58:
59: public int getColumn() {
60:
61: return this .col;
62:
63: }
64:
65: public int getLine() {
66:
67: return this .line;
68:
69: }
70:
71: public File getFile() {
72:
73: return this.f;
74:
75: }
76:
77: }
|