diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-01-10 23:47:44 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-01-10 23:47:44 +0100 |
commit | e893d9f9a99517b2b2191db80be4d18d88e29dcf (patch) | |
tree | 5b4211514d9e3cfc9f0bb149161ec03e70a7a9a9 /core/src/ch/asynk | |
parent | fb3533a5da51e30bc3d18a22a79f807dd45261da (diff) | |
download | RustAndDust-e893d9f9a99517b2b2191db80be4d18d88e29dcf.zip RustAndDust-e893d9f9a99517b2b2191db80be4d18d88e29dcf.tar.gz |
ArrayListIt: add push pop enqueue dequeue
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/rustanddust/engine/util/ArrayListIt.java | 20 |
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() |