-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathKassarij.java
69 lines (53 loc) · 1.11 KB
/
Kassarij.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import java.util.ArrayList;
/**
* Class Kassarij
*
* @author Hylke de Vries
* @version 1.0
*/
public class Kassarij
{
//--- Variabelen
private ArrayList<Persoon> persoon;
//--- Constructor
public Kassarij(){
this.persoon = new ArrayList<Persoon>();
}
//--- Getters
/**
* Checks wether there is a queue
*
* @return boolean true or false
*/
public boolean isErEenRij(){
return (this.persoon.size() >= 1);
}
/**
* Returns the first person that will be served next.
*
* @return Person
*/
public Persoon eerstePersoonInRij(){
if(isErEenRij()){
return this.persoon.get(0);
}
// Geen rij
return null;
}
//--- Setters
//--- Voids
/**
* Join the queue
*
* @return void
*/
public void sluitAchteraan(Persoon pers){
this.persoon.add(pers);
}
/**
* Verwijderd een persoon uit de rij
*/
public void verwijderPersoonUitRij(){
this.persoon.remove(0);
}
}