1 | public class A↵ | | 1 | public class ↵
|
2 | {↵ | | |
|
3 | // Constants -----------------------------------------------------------------------------------↵ | | |
|
|
4 | // Static --------------------------------------------------------------------------------------↵ | | |
|
|
5 | // Attributes ----------------------------------------------------------------------------------↵ | | |
|
|
6 | ↵ | | 2 | DataPoint implements Serializable {↵
|
7 | private long id;↵ | | 3 | private long id;↵
|
|
8 | private String data;↵ | | |
|
|
9 | // A 1 - * H↵ | | |
|
10 | private Set hs;↵ | | |
|
|
11 | // A 1 - 1 G↵ | | |
|
12 | private G g;↵ | | |
|
|
|
13 | // Constructors --------------------------------------------------------------------------------↵ | | |
|
|
14 | public A()↵ | | |
|
15 | {↵ | | |
|
16 | hs = new HashSet();↵ | | |
|
17 | }↵ | | |
|
|
18 | public A(String data)↵ | | |
|
19 | {↵ | | |
|
20 | this();↵ | | |
|
21 | this.data = data;↵ | | |
|
22 | }↵ | | |
|
|
23 | // Public --------------------------------------------------------------------------------------↵ | | |
|
|
24 | ↵ | | |
|
| | | 4 | private BigDecimal x;↵
|
| | | 5 | private BigDecimal y;↵
|
| | | 6 | private String description;↵
|
|
| | | 7 | public DataPoint() {↵
|
| | | 8 | }↵
|
|
| | | 9 | public DataPoint(BigDecimal x, BigDecimal y, String description) {↵
|
| | | 10 | this.x = x;↵
|
| | | 11 | this.y = y;↵
|
| | | 12 | this.description = description;↵
|
| | | 13 | }↵
|
|
| | | 14 | /**↵
|
| | | 15 | * @return Returns the description.↵
|
| | | 16 | */↵
|
25 | public long getId()↵ | | 17 | public String get↵
|
26 | {↵ | | |
|
27 | return id;↵ | | |
|
28 | }↵ | | |
|
|
29 | public void setId(long id)↵ | | |
|
30 | {↵ | | |
|
31 | this.id = id;↵ | | |
|
32 | }↵ | | |
|
|
33 | ↵ | | 18 | Description() {↵
|
| | | 19 | return description;↵
|
| | | 20 | }↵
|
| | | 21 | /**↵
|
| | | 22 | * @param description The description to set.↵
|
| | | 23 | */↵
|
34 | public void setData(String data)↵ | | 24 | public void setD↵
|
35 | {↵ | | |
|
36 | this.data = data;↵ | | |
|
37 | }↵ | | |
|
|
38 | ↵ | | 25 | escription(String description) {↵
|
| | | 26 | this.description = description;↵
|
| | | 27 | }↵
|
| | | 28 | /**↵
|
| | | 29 | * @return Returns the id.↵
|
| | | 30 | */↵
|
39 | public String getData()↵ | | 31 | public long get↵
|
40 | {↵ | | |
|
41 | return data;↵ | | |
|
42 | }↵ | | |
|
|
43 | public void setHs(Set hs)↵ | | |
|
44 | {↵ | | |
|
45 | ↵ | | 32 | Id() {↵
|
| | | 33 | return id;↵
|
| | | 34 | }↵
|
| | | 35 | /**↵
|
| | | 36 | * @param id The id to set.↵
|
| | | 37 | */↵
|
| | | 38 | public void setId(long id) {↵
|
46 | this.hs = hs;↵ | | 39 | this.id = ↵
|
47 | }↵ | | |
|
|
48 | public Set getHs()↵ | | |
|
49 | {↵ | | |
|
50 | return hs;↵ | | |
|
51 | }↵ | | |
|
|
52 | public void setG(G g)↵ | | |
|
53 | {↵ | | |
|
54 | ↵ | | 40 | id;↵
|
| | | 41 | }↵
|
| | | 42 | /**↵
|
| | | 43 | * @return Returns the x.↵
|
| | | 44 | */↵
|
| | | 45 | public BigDecimal getX() {↵
|
| | | 46 | return x;↵
|
| | | 47 | }↵
|
| | | 48 | /**↵
|
| | | 49 | * @param x The x to set.↵
|
| | | 50 | */↵
|
| | | 51 | public void setX(BigDecimal x) {↵
|
55 | this.g = g;↵ | | 52 | this.x = ↵
|
56 | }↵ | | |
|
|
57 | public G↵ | | 53 | x;↵
|
| | | 54 | }↵
|
| | | 55 | /**↵
|
| | | 56 | * @return Returns the y.↵
|
| | | 57 | */↵
|
58 | getG()↵ | | 58 | public BigDecimal getY()↵
|
59 | {↵ | | |
|
60 | return g;↵ | | |
|
61 | }↵ | | |
|
|
62 | public void addH(H h)↵ | | |
|
63 | {↵ | | |
|
64 | hs.add(h);↵ | | |
|
65 | h.setA(this);↵ | | |
|
66 | }↵ | | |
|
|
67 | public String toString()↵ | | |
|
68 | {↵ | | |
|
69 | return "A[" + id + ", " + data + "]";↵ | | |
|
70 | | | 59 | {↵
|
| | | 60 | return y;↵
|
| | | 61 | }↵
|
| | | 62 | /**↵
|
| | | 63 | * @param y The y to set.↵
|
| | | 64 | */↵
|
| | | 65 | public void setY(BigDecimal y) {↵
|
| | | 66 | this.y = y;↵
|
| | | 67 | }↵
|
| | | 68 | ↵
|
| | | 69 | void exception() throws Exception {↵
|
| | | 70 | throw new Exception("foo");↵
|
| | | 71 |
|