01: package org.incava.text;
02:
03: import java.io.*;
04: import java.util.*;
05:
06: /**
07: * Code location.
08: */
09: public class Location {
10: public int line;
11:
12: public int column;
13:
14: public Location(int line, int column) {
15: this .line = line;
16: this .column = column;
17: }
18:
19: public String toString() {
20: return "[line: " + line + ", column: " + column + "]";
21: }
22:
23: public boolean equals(Object obj) {
24: return obj instanceof Location && equals((Location) obj);
25: }
26:
27: public boolean equals(Location other) {
28: return other.line == line && other.column == column;
29: }
30:
31: }
|