]> git.somenet.org - pub/jan/sbc.git/blob - src/main/java/at/ac/tuwien/sbc/valesriegler/types/Table.java
added some not really helpful class descriptions + removed types that got duplicated...
[pub/jan/sbc.git] / src / main / java / at / ac / tuwien / sbc / valesriegler / types / Table.java
1 package at.ac.tuwien.sbc.valesriegler.types;
2
3 import java.io.Serializable;
4
5 /**
6  * A table is a thing, where people can put things at. Possibly a laptop, to
7  * have free hands to hold a pizzabox on the knees.
8  * 
9  * @author jan
10  * 
11  */
12 public class Table implements Serializable {
13         private static int idNext = 0;
14         private final int id;
15
16         private int groupId = -1;
17
18         public Table(int id) {
19                 this.id = id;
20         }
21
22         public Table() {
23                 id = ++idNext;
24         }
25
26         public int getId() {
27                 return id;
28         }
29
30         public int getGroupId() {
31                 return groupId;
32         }
33
34         public void setGroupId(int groupId) {
35                 this.groupId = groupId;
36         }
37
38         public boolean isFree() {
39                 if (groupId == -1)
40                         return true;
41                 return false;
42         }
43
44         @Override
45         public String toString() {
46                 return "Table [id=" + id + "]";
47         }
48
49 }