summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-01-10 23:47:44 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-01-10 23:47:44 +0100
commite893d9f9a99517b2b2191db80be4d18d88e29dcf (patch)
tree5b4211514d9e3cfc9f0bb149161ec03e70a7a9a9
parentfb3533a5da51e30bc3d18a22a79f807dd45261da (diff)
downloadRustAndDust-e893d9f9a99517b2b2191db80be4d18d88e29dcf.zip
RustAndDust-e893d9f9a99517b2b2191db80be4d18d88e29dcf.tar.gz
ArrayListIt: add push pop enqueue dequeue
-rw-r--r--core/src/ch/asynk/rustanddust/engine/util/ArrayListIt.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/util/ArrayListIt.java b/core/src/ch/asynk/rustanddust/engine/util/ArrayListIt.java
index 7c1e404..37e4b1f 100644
--- a/core/src/ch/asynk/rustanddust/engine/util/ArrayListIt.java
+++ b/core/src/ch/asynk/rustanddust/engine/util/ArrayListIt.java
@@ -18,6 +18,26 @@ public class ArrayListIt<E> extends ArrayList<E> implements Iterator, Iterable<E
super(n);
}
+ public void push(E e)
+ {
+ add(e);
+ }
+
+ public E pop()
+ {
+ return remove(size() - 1);
+ }
+
+ public void enqueue(E e)
+ {
+ add(e);
+ }
+
+ public E dequeue()
+ {
+ return remove(0);
+ }
+
@Override
@SuppressWarnings("unchecked")
public Iterator<E> iterator()