Created
January 12, 2014 17:32
-
-
Save b-studios/8387801 to your computer and use it in GitHub Desktop.
`IdentityHashMap` as adopted from `scala.collection.mutable.WeakHashMap`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.bstudios.collection.mutable | |
import scala.collection.mutable._ | |
import scala.collection.generic._ | |
import scala.collection.convert.Wrappers._ | |
class IdentityHashMap[A, B] extends JMapWrapper[A, B](new java.util.IdentityHashMap) | |
with JMapWrapperLike[A, B, IdentityHashMap[A, B]] { | |
override def empty = new IdentityHashMap[A, B] | |
} | |
object IdentityHashMap extends MutableMapFactory[IdentityHashMap] { | |
implicit def canBuildFrom[A, B]: CanBuildFrom[Coll, (A, B), IdentityHashMap[A, B]] = | |
new MapCanBuildFrom[A, B] | |
def empty[A, B]: IdentityHashMap[A, B] = new IdentityHashMap[A, B] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment