scala.collection.mutable

trait Publisher

[source: scala/collection/mutable/Publisher.scala]

trait Publisher[Evt]
extends AnyRef
Publisher[A,This] objects publish events of type A to all registered subscribers. When subscribing, a subscriber may specify a filter which can be used to constrain the number of events sent to the subscriber. Subscribers may suspend their subscription, or reactivate a suspended subscription. Class Publisher is typically used as a mixin. The abstract type Pub models the type of the publisher itself.
Author
Matthias Zenger
Martin Odersky
Version
2.8
Since
1
Direct Known Subclasses:
ObservableBuffer, ObservableMap, ObservableSet

Type Summary
type Filter
abstract type Pub <: Publisher[Evt]
type Sub
Value Summary
protected val self : Pub
The publisher itself of type `Pub'. Implemented by a cast from `this' here. Needs to be overridden if the actual publisher is different from `this'.
Method Summary
def activateSubscription (sub : Subscriber) : Unit
override def equals (obj : Any) : Boolean
Checks if two publishers are structurally identical.
protected def publish (event : Evt) : Unit
def removeSubscription (sub : Subscriber) : Unit
def removeSubscriptions : Unit
def subscribe (sub : Subscriber, filter : Function1) : Unit
def subscribe (sub : Subscriber) : Unit
def suspendSubscription (sub : Subscriber) : Unit
Methods inherited from AnyRef
getClass, hashCode, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Type Details
abstract type Pub <: Publisher[Evt]

type Sub

type Filter

Value Details
protected val self : Pub
The publisher itself of type `Pub'. Implemented by a cast from `this' here. Needs to be overridden if the actual publisher is different from `this'.

Method Details
def subscribe(sub : Subscriber) : Unit

def subscribe(sub : Subscriber, filter : Function1) : Unit

def suspendSubscription(sub : Subscriber) : Unit

def activateSubscription(sub : Subscriber) : Unit

def removeSubscription(sub : Subscriber) : Unit

def removeSubscriptions : Unit

protected def publish(event : Evt) : Unit

override def equals(obj : Any) : Boolean
Checks if two publishers are structurally identical.
Returns
true, iff both publishers contain the same sequence of elements.