-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRecommendedNutrient.java
47 lines (37 loc) · 1.38 KB
/
RecommendedNutrient.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
package hw3;
//Sahib Singh
//AndrewId: sahibsin
import javafx.beans.property.FloatProperty;
import javafx.beans.property.SimpleFloatProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
/*
* A Java bean with nutrientCode and nutrientQuantity as private properties, and public getters and setters. It has a
default constructor that initializes nutrientCode to empty string. Its non-default constructor initializes nutrientCode,
and nutrientQuantity using the values passed to it.
*/
public class RecommendedNutrient {
StringProperty nutrientCode = new SimpleStringProperty();
FloatProperty nutrientQuantity = new SimpleFloatProperty();
public RecommendedNutrient() {
// TODO Auto-generated constructor stub
this.nutrientCode.set("");
// this.nutrientQuantity.set(0);
}
public RecommendedNutrient(String nutrientCode, float nutrientQuantity) {
this.nutrientCode.set(nutrientCode);
this.nutrientQuantity.set(nutrientQuantity);
}
public String getNutrientCode() {
return nutrientCode.get();
}
public void setNutrientCode(StringProperty nutrientCode) {
this.nutrientCode = nutrientCode;
}
public Float getNutrientQuantity() {
return nutrientQuantity.get();
}
public void setNutrientQuantity(FloatProperty nutrientQuantity) {
this.nutrientQuantity = nutrientQuantity;
}
}