-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFach.java
More file actions
41 lines (32 loc) · 780 Bytes
/
Fach.java
File metadata and controls
41 lines (32 loc) · 780 Bytes
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
/**
* @author Pascal
*/
public class Fach implements java.io.Serializable {
private Queue<Vokabel> vokabeln;
private int limit;
private int counter;
public Fach(int pLimit) {
limit = pLimit;
vokabeln = new Queue<>();
}
public void VokabelHinzufuegen(Vokabel pVokabel) {
vokabeln.enqueue(pVokabel);
counter++;
}
public void deleteFirst() {
vokabeln.dequeue();
counter--;
}
public Vokabel getFirst() {
return vokabeln.front();
}
public Queue<Vokabel>.QueueNode getFirstNode() {
return vokabeln.first();
}
public boolean isLimitExceeded() {
return counter >= limit;
}
public boolean isEmpty(){
return getFirst() == null;
}
}