-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTool.java
More file actions
62 lines (55 loc) · 1.4 KB
/
Tool.java
File metadata and controls
62 lines (55 loc) · 1.4 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
import java.math.BigDecimal;
/**
* @author Chan Tran
* @version 09/18/2017
*
* This class is used for creating the tool. A tool has a tool type, brand, tool code, and daily charge.
*/
public class Tool {
private String toolType;
private String brand;
private String toolCode;
private BigDecimal dailyCharge;
public Tool()
{
toolType = "";
brand = "";
toolCode = "";
dailyCharge = new BigDecimal(0);
}
public Tool(String toolType, String brand, String toolCode, double dailyCharge) {
this.toolType = toolType;
this.brand = brand;
this.toolCode = toolCode;
this.dailyCharge = new BigDecimal(dailyCharge).setScale(2, BigDecimal.ROUND_HALF_UP);
}
public String getToolType() {
return toolType;
}
public void setToolType(String toolType) {
this.toolType = toolType;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public String getToolCode() {
return toolCode;
}
public void setToolCode(String toolCode) {
this.toolCode = toolCode;
}
public BigDecimal getDailyCharge() {
return dailyCharge;
}
public void setDailyCharge(BigDecimal dailyCharge) {
this.dailyCharge = dailyCharge;
}
@Override
public String toString() {
return "Tool [toolType=" + toolType + ", brand=" + brand + ", toolCode=" + toolCode + ", dailyCharge="
+ dailyCharge + "]";
}
}