KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > josql > functions > FileMatch


1 /*
2  * Copyright 2004-2005 Gary Bentley
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may
5  * not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * 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 JavaDoc;
18
19 /**
20  * This class represents the match of a String in a file.
21  *
22  * <p>
23  * Last Modified By: $Author: barrygently $<br />
24  * Last Modified On: $Date: 2005/01/04 13:16:11 $<br />
25  * Current Revision: $Revision: 1.1 $<br />
26  */

27 public class FileMatch
28 {
29
30     private File JavaDoc f = null;
31     private int line = 0;
32     private int col = 0;
33     private String JavaDoc str = null;
34     private String JavaDoc oLine = null;
35
36     public FileMatch (File JavaDoc f,
37               int line,
38               int col,
39               String JavaDoc str,
40               String JavaDoc oLine)
41     {
42
43     this.f = f;
44     this.line = line;
45     this.col = col;
46     this.str = str;
47     this.oLine = oLine;
48
49     }
50
51     public String JavaDoc toString ()
52     {
53
54     return this.f.getPath () + "[" + this.line + "," + this.col + "] \"" + this.str + "\" " + this.oLine;
55
56     }
57
58     public String JavaDoc getOriginalLine ()
59     {
60
61     return this.oLine;
62
63     }
64
65     public String JavaDoc getString ()
66     {
67
68     return this.str;
69
70     }
71
72     public int getColumn ()
73     {
74
75     return this.col;
76
77     }
78
79     public int getLine ()
80     {
81
82     return this.line;
83
84     }
85
86     public File JavaDoc getFile ()
87     {
88
89     return this.f;
90
91     }
92
93 }
94
Popular Tags