KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > incava > text > Location


1 package org.incava.text;
2
3 import java.io.*;
4 import java.util.*;
5
6
7 /**
8  * Code location.
9  */

10 public class Location
11 {
12     public int line;
13     
14     public int column;
15
16     public Location(int line, int column)
17     {
18         this.line = line;
19         this.column = column;
20     }
21
22     public String JavaDoc toString()
23     {
24         return "[line: " + line + ", column: " + column + "]";
25     }
26
27     public boolean equals(Object JavaDoc obj)
28     {
29         return obj instanceof Location && equals((Location)obj);
30     }
31
32     public boolean equals(Location other)
33     {
34         return other.line == line && other.column == column;
35     }
36
37 }
38
Popular Tags