|
1 |
| package photospace.space; |
|
2 |
| |
|
3 |
| import org.apache.commons.lang.builder.*; |
|
4 |
| |
|
5 |
| public class UTMPoint |
|
6 |
| { |
|
7 |
| private int x; |
|
8 |
| private int y; |
|
9 |
| private int zone; |
|
10 |
| private boolean north; |
|
11 |
| |
|
12 |
7
| public UTMPoint(int x, int y, int zone, boolean isNorth)
|
|
13 |
| { |
|
14 |
7
| this.x = x;
|
|
15 |
7
| this.y = y;
|
|
16 |
7
| this.zone = zone;
|
|
17 |
7
| this.north = isNorth;
|
|
18 |
| } |
|
19 |
| |
|
20 |
6
| public int getX()
|
|
21 |
| { |
|
22 |
6
| return x;
|
|
23 |
| } |
|
24 |
| |
|
25 |
6
| public int getY()
|
|
26 |
| { |
|
27 |
6
| return y;
|
|
28 |
| } |
|
29 |
| |
|
30 |
6
| public int getZone()
|
|
31 |
| { |
|
32 |
6
| return zone;
|
|
33 |
| } |
|
34 |
| |
|
35 |
6
| public boolean isNorth()
|
|
36 |
| { |
|
37 |
6
| return north;
|
|
38 |
| } |
|
39 |
| |
|
40 |
2
| public boolean equals(Object o)
|
|
41 |
| { |
|
42 |
0
| if (! (o instanceof UTMPoint)) return false;
|
|
43 |
2
| UTMPoint other = (UTMPoint) o;
|
|
44 |
2
| return new EqualsBuilder().append(x, other.getX())
|
|
45 |
| .append(y, other.getY()) |
|
46 |
| .append(zone, other.getZone()) |
|
47 |
| .append(north, other.isNorth()).isEquals(); |
|
48 |
| } |
|
49 |
| |
|
50 |
0
| public int hashCode()
|
|
51 |
| { |
|
52 |
0
| return new HashCodeBuilder().append(x)
|
|
53 |
| .append(y) |
|
54 |
| .append(zone) |
|
55 |
| .append(north).toHashCode(); |
|
56 |
| } |
|
57 |
| |
|
58 |
0
| public String toString()
|
|
59 |
| { |
|
60 |
0
| return "UTMPoint[" + x + "," + y + " " + (north ? "north" : "south") + " zone " + zone + "]";
|
|
61 |
| } |
|
62 |
| } |