-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnnualMilk.java
More file actions
94 lines (81 loc) · 2.13 KB
/
AnnualMilk.java
File metadata and controls
94 lines (81 loc) · 2.13 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/**
* AnnualMilk created by Weihang Guo on MacBook in a3
*
* Author: Weihang Guo(wguo63@wisc.edu)
* Date: @4.21
*
* Course: CS400
* Semester: Spring 2020
* Lecture: 002
*
* IDE: Eclipse IDE for Java Developers
* Version: 2019-12(4.14.0)
* Build id: 20191212-1212
*
* Device: LisaG's MACBOOK
* OS: macOS Mojave
* Version: 10.14.4
* OS Build: 1.8 GHz Intel Core i5
*
* List Collaborators: None
*
* Other Credits: None
*
* Known Bugs: None
*/
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
/**
* The Class Annual Milk.
*/
public class AnnualMilk {
/** The farm ID. */
private final SimpleStringProperty farmID;
/** The weight. */
private final SimpleIntegerProperty weight;
/** The percentage. */
private final SimpleDoubleProperty percentage;
/**
* Instantiates.
*
* @param farmID the farm ID
* @param weight the weight
* @param percentage the percentage
*/
AnnualMilk(String farmID, Integer weight, Double percentage) {
this.farmID = new SimpleStringProperty(farmID);
this.weight = new SimpleIntegerProperty(weight);
this.percentage = new SimpleDoubleProperty(percentage);
}
/**
* Gets the farm ID.
*
* @return the farm ID
*/
public String getFarmID() {
return farmID.get();
}
/**
* Gets the weight.
*
* @return the weight
*/
public Integer getWeight() {
return weight.get();
}
/**
* Gets the percentage.
*
* @return the percentage
*/
public Double getPercentage() {
return percentage.get();
}
public static String getTitles() {
return "farmID, weight, percentage";
}
public String getValueString() {
return farmID.getValue() + "," + weight.getValue() + "," +percentage.getValue();
}
}