-
Notifications
You must be signed in to change notification settings - Fork 0
/
Item.java
65 lines (49 loc) · 1.3 KB
/
Item.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**
* Created by henryhargreaves on 10/11/2015.
*/
public class Item {
static int uniqueCatalogueNo = 0;
int ID;
private String title, type;
private float value;
Museum museum;
int noOfItems =0;
static final int MAX_NUMBER_EXHIBITIONS = 10;
Exhibition [] exhibitions = new Exhibition[MAX_NUMBER_EXHIBITIONS];
public Item(float value, String type, String title, Museum museum) {
this.value = value;
this.type = type;
this.title = title;
this.museum = museum;
}
public void newCatalogueNo (){
uniqueCatalogueNo++;
this.ID=uniqueCatalogueNo;
}
public void addExhibition(Exhibition exhibition) {
this.exhibitions[noOfItems] = exhibition;
noOfItems++;
}
public void printDetails(){
System.out.println("Unique Catalogue No: "+ID+
" Title:" +title+ "Museum: "+ museum);
}
public int getUniqueCatalogueNo() {
return uniqueCatalogueNo;
}
public float getValue() {
return value;
}
public String getType() {
return type;
}
public String getTitle() {
return title;
}
public Museum getMuseum() {
return museum;
}
public Exhibition[] getExhibitions() {
return exhibitions;
}
}