summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorMatthias Zenger <mzenger@gmail.com>2003-06-19 11:00:43 +0000
committerMatthias Zenger <mzenger@gmail.com>2003-06-19 11:00:43 +0000
commit0e1e141430164cf481708939eff82ff27cbd0ede (patch)
treeb2151e75e134bd78cd6ceb1fa8ca51b4011920dc /sources
parent23f124d305e9e7af7859ace8c0be3aa0fa6fc518 (diff)
downloadscala-0e1e141430164cf481708939eff82ff27cbd0ede.tar.gz
scala-0e1e141430164cf481708939eff82ff27cbd0ede.tar.bz2
scala-0e1e141430164cf481708939eff82ff27cbd0ede.zip
This file is now called DefaultMapModel.scala
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/MapImpl.scala50
1 files changed, 0 insertions, 50 deletions
diff --git a/sources/scala/MapImpl.scala b/sources/scala/MapImpl.scala
deleted file mode 100644
index 0082f102b9..0000000000
--- a/sources/scala/MapImpl.scala
+++ /dev/null
@@ -1,50 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-** $Id$
-\* */
-
-package scala;
-
-
-trait MapImpl[A, B] extends MutableMap[A, B] {
-
- protected def findEntry(key: A): Option[Entry];
-
- protected def addEntry(e: Entry): Unit;
-
- protected def removeEntry(key: A): Unit;
-
- protected def entries: Iterator[Entry];
-
- def get(key: A) = findEntry(key) match {
- case None => None
- case Some(e) => Some(e.value);
- }
-
- def update(key: A, value: B) = findEntry(key) match {
- case None => addEntry(new Entry(key, value));
- case Some(e) => e.value = value;
- }
-
- def remove(key: A) = findEntry(key) match {
- case None => null;
- case Some(e) => removeEntry(key); e.value;
- }
-
- def elements = new Iterator[Pair[A, B]] {
- val iter = entries;
- def hasNext = iter.hasNext;
- def next = iter.next.toPair;
- }
-
- protected class Entry(k: A, v: B) {
- def key = k;
- var value = v;
- def toPair = Pair(k, value);
- override def toString() = k.toString() + " -> " + value;
- }
-}