scala.collection.mutable

class History

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

@serializable

@SerialVersionUID(5219213543849892588L)

class History[A, B]
extends Subscriber[A, B] with Iterable[(B, A)]
History[A, B] objects may subscribe to events of type A published by an object of type B. The history subscriber object records all published events up to maximum number of maxHistory events.
Author
Matthias Zenger
Version
1.0, 08/07/2003
Since
1
Direct Known Subclasses:
RevertibleHistory

Value Summary
protected val log : Queue[(B, A)]
val maxHistory : Int
Method Summary
def clear : Unit
override def equals (obj : Any) : Boolean
Checks if two history objects are structurally identical.
def events : Iterator[A]
def iterator : Iterator[(B, A)]
Creates a new iterator over all elements contained in this iterable object.
def notify (pub : B, event : A) : Unit
override def size : Int
The number of elements in this collection
Methods inherited from Iterable
companion
Methods inherited from IterableLike
thisCollection, toCollection, elements, foreach, forall, exists, find, isEmpty, foldRight, reduceRight, toIterable, head, take, slice, takeWhile, takeRight, dropRight, copyToArray, zip, zipAll, zipWithIndex, sameElements, toStream, canEqual, view, view, first, firstOption, projection
Methods inherited from GenericTraversableTemplate
newBuilder, genericBuilder, unzip, flatten, transpose
Methods inherited from TraversableLike
repr, nonEmpty, hasDefiniteSize, ++, ++, map, flatMap, filter, filterNot, partialMap, remove, partition, groupBy, count, foldLeft, /:, :\, reduceLeft, reduceLeftOption, reduceRightOption, sum, product, min, max, headOption, tail, last, lastOption, init, drop, dropWhile, span, splitAt, copyToBuffer, copyToArray, toArray, toList, toSeq, toIndexedSeq, toSet, mkString, mkString, mkString, addString, addString, addString, toString, stringPrefix, withFilter
Methods inherited from AnyRef
getClass, hashCode, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Value Details
protected val log : Queue[(B, A)]

val maxHistory : Int

Method Details
def notify(pub : B, event : A) : Unit
Parameters
pub - ...
event - ...
Overrides
Subscriber.notify

override def size : Int
The number of elements in this collection

def iterator : Iterator[(B, A)]
Creates a new iterator over all elements contained in this iterable object.
Returns
the new iterator

def events : Iterator[A]

def clear : Unit

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