-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMove.java
47 lines (39 loc) · 768 Bytes
/
Move.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import java.io.Serializable;
public class Move implements Serializable
{
private static final long serialVersionUID = 1L;
private int row;
private int column;
public Move(int row, int column)
{
this.row = row;
this.column = column;
}
public Move()
{
this.row = Integer.MIN_VALUE;
this.column = Integer.MIN_VALUE;
}
public Move(Move m)
{
this.row = new Integer(m.row);
this.column = new Integer(m.column);
}
public boolean equals(Object m)
{
Move move = new Move((Move)m);
return (this.getRow() == move.getRow()) && (this.getColumn() == move.getColumn());
}
public int getRow()
{
return this.row;
}
public int getColumn()
{
return this.column;
}
public String toString()
{
return "[" + row + "," + column + "]";
}
}