diff options
Diffstat (limited to 'src/main/java/net/transit/network/packet/ArrayPacket.java')
-rw-r--r-- | src/main/java/net/transit/network/packet/ArrayPacket.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/net/transit/network/packet/ArrayPacket.java b/src/main/java/net/transit/network/packet/ArrayPacket.java index 9cbd300..fbea811 100644 --- a/src/main/java/net/transit/network/packet/ArrayPacket.java +++ b/src/main/java/net/transit/network/packet/ArrayPacket.java @@ -4,7 +4,7 @@ import java.util.ArrayList; import net.transit.type.Type; -public class ArrayPacket<D> implements IPacket<D> +public class ArrayPacket<D> implements Packet<D> { private ArrayList<D> arrayData; private Type<D> type; @@ -13,8 +13,10 @@ public class ArrayPacket<D> implements IPacket<D> { arrayData = new ArrayList<D>(0); arrayData.add(startValue); + type = t; } - + + @Override public D getData() { if(arrayData.size() > 0) return arrayData.get(0); @@ -25,6 +27,11 @@ public class ArrayPacket<D> implements IPacket<D> { arrayData.add(data); } + + public int dataStored() + { + return arrayData.size(); + } public D popAndShift() { |