Commit 3427f5e4 authored by Kunshan Wang's avatar Kunshan Wang

Instruction tests (partial)

parent 57f6e08d
...@@ -8,6 +8,8 @@ abstract class Namespace[T <: Identified] { ...@@ -8,6 +8,8 @@ abstract class Namespace[T <: Identified] {
def get(name: String): Option[T] def get(name: String): Option[T]
def add(obj: T): Unit def add(obj: T): Unit
def all: Iterable[T]
} }
class SimpleNamespace[T <: Identified] extends Namespace[T] { class SimpleNamespace[T <: Identified] extends Namespace[T] {
...@@ -39,4 +41,6 @@ class SimpleNamespace[T <: Identified] extends Namespace[T] { ...@@ -39,4 +41,6 @@ class SimpleNamespace[T <: Identified] extends Namespace[T] {
case Some(name) => nameMap.put(name, obj) case Some(name) => nameMap.put(name, obj)
} }
} }
def all = idMap.values
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment