This commit is contained in:
Andrey Breslav
2010-11-08 14:36:37 +03:00
parent 0845cb27a0
commit 369b197478
35 changed files with 958 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
sealed class Stack<T> : IPushPop<T> {
private val data = new ArrayList<T>();
override fun push(item : T) {
data.add(item) // Problem: I would like to write push(...) = data.add(...), but the types do not match
}
override fun pop() = data.removeLast()
override val isEmpty { // TODO: This is UGLY :(
get() = data.isEmpty
}
}