-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.java
More file actions
86 lines (66 loc) · 1.67 KB
/
node.java
File metadata and controls
86 lines (66 loc) · 1.67 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
public class node {
public ProduceItem data;
public node next;
/**Default constructor*/
public node () {
data = null;
next = null;
}
/**
* One argument constructor.
* @param data, a object
*/
public node (ProduceItem data) {
this.data = data;
next = null;
}
/**
* Two argument constructor that sets data and next.
* @param data, a object
* @param next, the next node
*/
public node (ProduceItem data, node next) {
this.data = data;
this.next = next;
}
/**
* Gets the next node.
* @return the next Node
*/
public node getNext(){return next;}
/**
* Sets the next node.
* @param n, the next Node
*/
public void setNext (node n) { next = n; }
/**
*getter method that gets data using the data from the ProduceList by using the the getter method getname();
* from the ProduceItem.java
* @return name
*/
public String getName(){
return data.getname();
}
/**
*getter method that gets data using the data from the ProduceList by using the the getter method getname();
* from the ProduceItem.java
* @return price
*/
public float getPrice(){
return data.getprice();
}
/**
*getter method that gets data using the data from the ProduceList by using the the getter method getcode();
* from the ProduceItem.java
* @return code
*/
public String getCode(){
return data.getcode();
}
public String getType(){
return data.gettype();
}
public ProduceItem getData() {
return data;
}
}