-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPoint.java
More file actions
81 lines (61 loc) · 1.38 KB
/
Point.java
File metadata and controls
81 lines (61 loc) · 1.38 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package main.java.com.example;
import java.util.Objects;
public class Point {
private String Nom;
private int Abscisse;
private int Ordonnée;
public Point(String Nom, int Abscisse, int Ordonnée) {
this.Nom = Nom;
this.Abscisse = Abscisse;
this.Ordonnée = Ordonnée;
}
public Point(int Abscisse, int Ordonnée) {
this.Abscisse = Abscisse;
this.Ordonnée = Ordonnée;
}
public Point(String Nom) {
this.Nom = Nom;
}
public String getNom() {
return this.Nom;
}
public void setNom(String Nom) {
this.Nom = Nom;
}
public int getAbscisse() {
return this.Abscisse;
}
public void setAbscisse(int Abscisse) {
this.Abscisse = Abscisse;
}
public int getOrdonnée() {
return this.Ordonnée;
}
public void setOrdonnée(int Ordonnée) {
this.Ordonnée = Ordonnée;
}
@Override
public String toString() {
return this.getNom()+"("+this.getAbscisse()+", "+this.getOrdonnée()+")";
}
public void Affiche(){
System.out.println(this);
}
public void TranslHoriz(int a){
this.Abscisse+=a;
}
public void TranslVert(int a){
this.Ordonnée+=a;
}
public void Translation(int a,int b){
this.TranslHoriz(a);
this.TranslVert(b);
}
public void Translation(int a){
this.TranslHoriz(a);
this.TranslVert(a);
}
public boolean Coincide (Point p){
return this.getAbscisse() == p.getAbscisse() && this.getOrdonnée() == p.getOrdonnée();
}
}