-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathInventory.java
122 lines (105 loc) · 2.59 KB
/
Inventory.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/**
* Inventory class that contains information about the inventory
*/
public class Inventory
{
// instance variables - replace the example below with your own
private String type;
private String description;
private double appraisal;
private double loan;
private String loandate;
private String status;
/**
* Null constructor
*/
public Inventory()
{
}
/**
* Constructor that accepts all variables
*/
public Inventory(String type, String description,
double appraisal, double loan,
String loandate, String status)
{
this.type = type;
this.description = description;
this.appraisal = appraisal;
this.loan = loan;
this.loandate = loandate;
this.status = status;
}
/**
* Setters and getters
*/
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return this.type;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return this.description;
}
public void setAppraisal(double appraisal)
{
this.appraisal = appraisal;
}
public double getAppraisal()
{
return this.appraisal;
}
public void setLoan(double loan)
{
this.loan = loan;
}
public double getLoan()
{
return this.loan;
}
public void setLoandate(String loandate)
{
this.loandate = loandate;
}
public String getLoandate()
{
return this.loandate;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return this.status;
}
/**
* toString function for printList
*/
public String toString()
{
return "Type: " + this.type + "\n" +
"Description: " + this.description + "\n" +
"Appraised Value: " + this.appraisal + "\n" +
"Loan Amount: " + this.loan + "\n" +
"Loan Date: " + this.loandate + "\n" +
"Status: " + this.status + "\n";
}
/**
* Prints the information in delimited format to update pawn_inventory.txt file
*/
public String toDelimitedString()
{
return this.type + ";" + this.description + ";" +
this.appraisal + ";" + this.loan + ";" +
this.loandate + ";" + this.status + "\n";
}
}