aboutsummaryrefslogtreecommitdiff
path: root/Mammoth/Couscous/mammoth/internal/util/Queues.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Mammoth/Couscous/mammoth/internal/util/Queues.cs')
-rw-r--r--Mammoth/Couscous/mammoth/internal/util/Queues.cs12
1 files changed, 8 insertions, 4 deletions
diff --git a/Mammoth/Couscous/mammoth/internal/util/Queues.cs b/Mammoth/Couscous/mammoth/internal/util/Queues.cs
index 9bf099c..325b29a 100644
--- a/Mammoth/Couscous/mammoth/internal/util/Queues.cs
+++ b/Mammoth/Couscous/mammoth/internal/util/Queues.cs
@@ -8,18 +8,22 @@ namespace Mammoth.Couscous.org.zwobble.mammoth.@internal.util
return new Stack<T>();
}
}
-
+
internal class Stack<T> : Queue<T> {
private readonly System.Collections.Generic.IList<T> _stack = new System.Collections.Generic.List<T>();
-
+
public Iterator<T> iterator() {
return ToJava.EnumeratorToIterator(_stack.GetEnumerator());
}
-
+
public void add(T value) {
_stack.Add(value);
}
-
+
+ public bool isEmpty() {
+ return _stack.Count == 0;
+ }
+
public T remove() {
var index = _stack.Count - 1;
var value = _stack[index];