]> git.somenet.org - pub/jan/sbc.git/blob - src/main/java/at/ac/tuwien/sbc/valesriegler/types/Table.java
Merge branch 'master' of https://bitbucket.org/rgregor/sbc-ss-2013
[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 import at.ac.tuwien.sbc.valesriegler.common.HasId;
6
7
8 /**
9  * A table is a thing, where people can put things at. Possibly a laptop, to
10  * have free hands to hold a pizzabox on the knees.
11  * 
12  * @author jan
13  * 
14  */
15 public class Table implements Serializable, HasId {
16         private static int idNext = 0;
17         private final int id;
18
19         private int groupId = -1;
20
21         public Table(int id) {
22                 this.id = id;
23         }
24
25         public Table() {
26                 id = ++idNext;
27         }
28
29         public int getId() {
30                 return id;
31         }
32
33         public int getGroupId() {
34                 return groupId;
35         }
36
37         public void setGroupId(int groupId) {
38                 this.groupId = groupId;
39         }
40
41         public boolean isFree() {
42                 if (groupId == -1)
43                         return true;
44                 return false;
45         }
46
47         @Override
48         public String toString() {
49                 return "Table [id=" + id + "]";
50         }
51
52 }