01: /**
02: *
03: * Copyright 2005 Jeremy Rayner
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: **/package org.codehaus.groovy.antlr;
18:
19: /**
20: * An object representing a line and column position
21: *
22: * @author <a href="mailto:groovy@ross-rayner.com">Jeremy Rayner</a>
23: * @version $Revision: 2250 $
24: */
25: public class LineColumn {
26: private int line;
27: private int column;
28:
29: public LineColumn(int line, int column) {
30: this .line = line;
31: this .column = column;
32: }
33:
34: public int getLine() {
35: return line;
36: }
37:
38: public int getColumn() {
39: return column;
40: }
41:
42: public boolean equals(Object that) {
43: if (this == that)
44: return true;
45: if (that == null || getClass() != that.getClass())
46: return false;
47:
48: final LineColumn lineColumn = (LineColumn) that;
49:
50: if (column != lineColumn.column)
51: return false;
52: if (line != lineColumn.line)
53: return false;
54:
55: return true;
56: }
57:
58: public int hashCode() {
59: int result;
60: result = line;
61: result = 29 * result + column;
62: return result;
63: }
64:
65: public String toString() {
66: return "[" + line + "," + column + "]";
67: }
68: }
|