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