summaryrefslogtreecommitdiffstats
path: root/tests/ajde/examples/figures-cacm/figures/Point.java
blob: 322c23ccaf333f8816731210c3573f3dfb89dbb1 (plain)
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
package figures;

class Point {
    private int x = 0, y = 0;

    Point(int x, int y) {
	    super();
	    this.x = x;
	    this.y = y;
    }

    int getX() {
        return x;
    }

    int getY() {
        return y;
    }

    void setX(int x) {
        this.x = x;
    }

    void setY(int y) {
        this.y = y;
    }

    void moveBy(int dx, int dy) {
	    setX(getX() + dx);
	    setY(getY() + dy);
    }
}