]> git.zerfleddert.de Git - FreeShisen/blob - src/de/cwde/freeshisen/Point.java
some TODOs done.
[FreeShisen] / src / de / cwde / freeshisen / Point.java
1 package de.cwde.freeshisen;
2
3 class Point {
4 public Point(int i, int j) {
5 this.i = i;
6 this.j = j;
7 }
8
9 public Point(Point p) {
10 this.i = p.i;
11 this.j = p.j;
12 }
13
14 public boolean equals(Point p) {
15 return (i == p.i && j == p.j);
16 }
17
18 public boolean equals(int myi, int myj) {
19 return (i == myi && j == myj);
20 }
21
22 public String toString() {
23 return "(" + i + "," + j + ")";
24 }
25
26 public void set(int i, int j) {
27 this.i = i;
28 this.j = j;
29 }
30
31 public static Point fromString(String s) {
32 String[] ij = s.split(",", 2);
33 int i = Integer.parseInt(ij[0]);
34 int j = Integer.parseInt(ij[1]);
35 return new Point(i, j);
36 }
37
38 public int i;
39 public int j;
40
41 public Point copy() {
42 return new Point(this.i, this.j);
43 }
44 }
Impressum, Datenschutz