summaryrefslogtreecommitdiff
path: root/Java-Kompendium/kap15/src/main/java/Mark.java
blob: d5bf8564cf51a7589e7d66eb3e97bb20e1589c96 (plain)
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
import javafx.beans.property.StringProperty;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;

public class Mark {
    private StringProperty subject;
    private IntegerProperty mark;

    public Mark(String subject, Integer mark) {
        subjectProperty().set(subject);
        markProperty().set(mark);
    }

    public StringProperty subjectProperty() {
        if (this.subject == null) {
            this.subject = new SimpleStringProperty(this, "subject");
        }
        return this.subject;
    }

    public IntegerProperty markProperty() {
        if (this.mark == null) {
            this.mark = new SimpleIntegerProperty(this, "mark");
        }
        return this.mark;
    }

    public String getSubject() {
        return this.subjectProperty().get();
    }

    public Integer getMark() {
        return this.markProperty().get();
    }
}