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

de.sciss.lucre.RefMap.scala Maven / Gradle / Ivy

Go to download

Extension of Scala-STM, adding optional durability layer, and providing API for confluent and reactive event layers

There is a newer version: 4.6.6
Show newest version
/*
 *  RefMap.scala
 *  (Lucre 4)
 *
 *  Copyright (c) 2009-2022 Hanns Holger Rutz. All rights reserved.
 *
 *  This software is published under the GNU Affero General Public License v3+
 *
 *
 *  For further information, please contact Hanns Holger Rutz at
 *  [email protected]
 */

package de.sciss.lucre

import scala.collection.immutable

trait RefMap[T <: Exec[T], K, V] {
  def put     (key: K, value: V)(implicit tx: T): Option[V]
  def get     (key: K)(implicit tx: T): Option[V]
  def remove  (key: K)(implicit tx: T): Option[V]
  def contains(key: K)(implicit tx: T): Boolean
  def size            (implicit tx: T): Int
  def isEmpty         (implicit tx: T): Boolean

  def foreach[B](f: ((K, V)) => B)(implicit tx: T): Unit

  def toMap(implicit tx: T): immutable.Map[K, V]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy