-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSmallHardwareItems.java
More file actions
45 lines (42 loc) · 1.31 KB
/
SmallHardwareItems.java
File metadata and controls
45 lines (42 loc) · 1.31 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
/**
*
* @author Tory Brewer and Ryan Franklin
*/
public class SmallHardwareItems extends Item {
protected final String category;
/**
* Constructor initializes a customer object with the provided values.
* @param idNumber
* @param name
* @param quantity
* @param price
* @param category a <b><CODE>String</CODE></b> that represents the category.
* Door, Window, Cabinet Furniture, Fasteners, Structural, Other.
*/
public SmallHardwareItems(String idNumber, String name, int quantity, float price, String category) {
super(idNumber, name, quantity, price);
this.category = category;
}
/**
* Get the category.
* @return category
*/
public String getCategory() {
return category;
}
/**
* Returns the attributes of the small hardware item, in a formatted text fashion.
* @return Formatted Text.
*/
@Override
public String getFormattedText() {
return String.format("| %-8s| %-25s| %-10s| %-10s| %-20s| %-30s|%n",
this.getIdNumber(),
this.getName(),
Integer.toString(this.getQuantity()),
String.format("%.2f", this.getPrice()),
"Small Hardware Items",
this.getCategory()
);
}
}