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

breeze.collection.mutable.AutoUpdater.scala Maven / Gradle / Ivy

There is a newer version: 1.0
Show newest version
package breeze.collection.mutable

import scala.collection.mutable._

/**
 * AutoUpdater wraps a Map such that any call to apply updates the map with an instance of the default value
 * @author dlwh
 */
class AutoUpdater[M,K,V](val theMap: M, default: =>V)(implicit ev: M<:V)(implicit ev: M<:V):AutoUpdater[Map[K,V],K,V] = apply(Map[K,V](),default);
  def ofKeys[K] = new {
    def andValues[V](v: =>V) = apply[K,V](v);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy