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

org.powerscala.property.ListProperty.scala Maven / Gradle / Ivy

The newest version!
package org.powerscala.property

/**
 * @author Matt Hicks 
 */
trait ListProperty[T] extends Property[List[T]] {
  def +=(t: T) = synchronized {
    this := (t :: value.reverse).reverse
  }
  def -=(t: T) = synchronized {
    this := value.filterNot(p => p == t)
  }
  def isEmpty = value.isEmpty
  def nonEmpty = value.nonEmpty
  def ++=(seq: Seq[T]) = synchronized {
    this := (seq.toList.reverse ::: value.reverse).reverse
  }
  def contains(t: T) = value.contains(t)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy