-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrzedmiot.java
More file actions
168 lines (133 loc) · 4.34 KB
/
Przedmiot.java
File metadata and controls
168 lines (133 loc) · 4.34 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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
package com.organizer.projektorganizer.model;
import java.time.LocalDate;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
public class Przedmiot {
private final StringProperty nazwaPrzedmiotu;
private final StringProperty kategoriaPrzedmiotu;
private final DoubleProperty cenaPrzedmiotu;
private final StringProperty miejsceZakupu;
private final ObjectProperty<LocalDate> dataZakupu;
private final ObjectProperty<LocalDate> terminPrzydatnosci;
private final ObjectProperty<LocalDate> waznoscGwarancji;
private final IntegerProperty ocenaPrzedmiotu;
private int IdPrzedmiotu;
/**
* Default constructor.
*/
public Przedmiot() {
this(null, null);
}
/**
* Constructor with some initial data.
*
* @param firstName
* @param lastName
*/
public Przedmiot(String nazwa, String kategoria) {
this.nazwaPrzedmiotu = new SimpleStringProperty(nazwa);
this.kategoriaPrzedmiotu = new SimpleStringProperty(kategoria);
this.IdPrzedmiotu = 0;
// Some initial dummy data, just for convenient testing.
this.cenaPrzedmiotu = new SimpleDoubleProperty();
this.miejsceZakupu = new SimpleStringProperty("");
this.dataZakupu = new SimpleObjectProperty<LocalDate>(null);
this.terminPrzydatnosci = new SimpleObjectProperty<LocalDate>(null);
this.waznoscGwarancji = new SimpleObjectProperty<LocalDate>(null);
this.ocenaPrzedmiotu = new SimpleIntegerProperty(0);
}
//gettery Property
public StringProperty getNazwaPrzedmiotuProperty() {
return nazwaPrzedmiotu;
}
public StringProperty getKategoriaPrzedmiotuProperty() {
return kategoriaPrzedmiotu;
}
public DoubleProperty getCenaPrzedmiotuProperty() {
return cenaPrzedmiotu;
}
public StringProperty getMiejsceZakupuProperty() {
return miejsceZakupu;
}
public ObjectProperty<LocalDate> getDataZakupuProperty() {
return dataZakupu;
}
public ObjectProperty<LocalDate> getTerminPrzydatnosciProperty() {
return terminPrzydatnosci;
}
public ObjectProperty<LocalDate> getWaznoscGwarancjiProperty() {
return waznoscGwarancji;
}
//gettery
public String getNazwaPrzedmiotu() {
return nazwaPrzedmiotu.get();
}
public String getKategoriaPrzedmiotu() {
return kategoriaPrzedmiotu.get();
}
public Double getCenaPrzedmiotu() {
return cenaPrzedmiotu.get();
}
public String getMiejsceZakupu() {
return miejsceZakupu.get();
}
public LocalDate getDataZakupu() {
return dataZakupu.get();
}
public LocalDate getTerminPrzydatnosci() {
return terminPrzydatnosci.get();
}
public LocalDate getWaznoscGwarancji() {
return waznoscGwarancji.get();
}
//settery
public void setNazwaPrzedmiotu(String nazwa)
{
this.nazwaPrzedmiotu.set(nazwa);
}
public void setKategoriaPrzedmiotu(String kategoria)
{
this.kategoriaPrzedmiotu.set(kategoria);
}
public void setCenaPrzedmiotu(double cena)
{
this.cenaPrzedmiotu.set(cena);
}
public void setMiejsceZakupu(String miejsce)
{
this.miejsceZakupu.set(miejsce);
}
public void setDataZakupu(LocalDate dataKupna)
{
this.dataZakupu.set(dataKupna);
}
public void setDataPrzydatnosci(LocalDate terminPrzyd)
{
this.terminPrzydatnosci.set(terminPrzyd);
}
public void setWaznoscGwarancji(LocalDate waznoscGwar)
{
this.waznoscGwarancji.set(waznoscGwar);
}
public void setIdPrzedmiotu(int IdPrzedmiotu){
this.IdPrzedmiotu = IdPrzedmiotu;
}
public int getIdPrzedmiot(){
return IdPrzedmiotu;
}
public void setOcena(int ocena){
this.ocenaPrzedmiotu.set(ocena);
}
public int getOcenaPrzedmiotu(){
return ocenaPrzedmiotu.get();
}
public IntegerProperty getOcenaPrzedmiotuProperty(){
return ocenaPrzedmiotu;
}
}