05e589641ce93d85d0795fa8ff04761a1792226e
[iotcloud.git] / src / java / iotcloud / TableStatus.java
1 package iotcloud;
2 import java.nio.ByteBuffer;
3
4 class TableStatus extends Entry {
5         int maxslots;
6         
7         TableStatus(Slot slot, int _maxslots) {
8                 super(slot);
9                 maxslots=_maxslots;
10         }
11         
12         static Entry decode(Slot slot, ByteBuffer bb) {
13                 int maxslots=bb.getInt();
14                 return new TableStatus(slot, maxslots);
15         }
16
17         void encode(ByteBuffer bb) {
18                 bb.put(Entry.TypeTableStatus);
19                 bb.putInt(maxslots);
20         }
21
22         int getSize() {
23                 return Integer.BYTES+Byte.BYTES;
24         }
25         
26         byte getType() {
27                 return Entry.TypeTableStatus;
28         }
29 }