All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.clulab.wm.eidoscommon.utils.IdentityHashBag.scala Maven / Gradle / Ivy

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