org.clulab.wm.eidoscommon.utils.IdentityHashBag.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eidos-eidoscommon_2.12 Show documentation
Show all versions of eidos-eidoscommon_2.12 Show documentation
Code to be shared by other Eidos subprojects and clients
The newest version!
package org.clulab.wm.eidoscommon.utils
import org.clulab.wm.eidoscommon.utils.IdentityHashMap.IdentityHashMap
class IdentityHashBag[K <: AnyRef](map: IdentityHashMap[K, Int]) extends HashBag[K](map) {
def this() = this(IdentityHashMap[K, Int]())
}
object IdentityHashBag {
def apply[T <: AnyRef](): IdentityHashBag[T] = new IdentityHashBag[T]()
def apply[T <: AnyRef](values: Seq[T]): IdentityHashBag[T] = apply[T]() ++ values
def apply[T <: AnyRef](values: Seq[T], getNeighbors: T => Iterable[T]): IdentityHashBag[T] =
apply[T]() ++ (values, getNeighbors)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy