-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSeat.java
More file actions
33 lines (25 loc) · 819 Bytes
/
Seat.java
File metadata and controls
33 lines (25 loc) · 819 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
package bookings;
public class Seat {
public static final char MIN_ROW = 'A';
public static final char MAX_ROW = 'G';
public static final int MIN_NUMBER = 1;
public static final int MAX_NUMBER = 20;
//@ invariant row >= MIN_ROW && row <= MAX_ROW;
//@ invariant number >= MIN_NUMBER && number <= MAX_NUMBER;
private final char row;
private final int number;
/*@
requires row >= MIN_ROW && row <= MAX_ROW;
requires number >= MIN_NUMBER && number <= MAX_NUMBER;
@*/
public Seat(char row, int number) {
this.row = row;
this.number = number;
}
public /*@ helper @*/ final char getRow() {
return row;
}
public /*@ helper @*/ final int getNumber() {
return number;
}
}