summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/mutable/ObservableBuffer.scala
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2006-10-04 12:18:48 +0000
committermichelou <michelou@epfl.ch>2006-10-04 12:18:48 +0000
commit9f013a7ccd34f6ee169ff7189f503a9f2b097fff (patch)
treec919bac9c550a1160f998b0acd4bff081cf98462 /src/library/scala/collection/mutable/ObservableBuffer.scala
parent3e985a3e8d8119ee1e9c417cd25345a819caabe9 (diff)
downloadscala-9f013a7ccd34f6ee169ff7189f503a9f2b097fff.tar.gz
scala-9f013a7ccd34f6ee169ff7189f503a9f2b097fff.tar.bz2
scala-9f013a7ccd34f6ee169ff7189f503a9f2b097fff.zip
removed leading/trailing tabs/blanks in collect...
removed leading/trailing tabs/blanks in collection/mutable/*.scala
Diffstat (limited to 'src/library/scala/collection/mutable/ObservableBuffer.scala')
-rw-r--r--src/library/scala/collection/mutable/ObservableBuffer.scala88
1 files changed, 44 insertions, 44 deletions
diff --git a/src/library/scala/collection/mutable/ObservableBuffer.scala b/src/library/scala/collection/mutable/ObservableBuffer.scala
index 1440fe6845..8112630da6 100644
--- a/src/library/scala/collection/mutable/ObservableBuffer.scala
+++ b/src/library/scala/collection/mutable/ObservableBuffer.scala
@@ -9,7 +9,7 @@
// $Id$
-package scala.collection.mutable;
+package scala.collection.mutable
/** This class is typically used as a mixin. It adds a subscription
@@ -26,53 +26,53 @@ trait ObservableBuffer[A, This <: ObservableBuffer[A, This]] requires This
with Undoable, This]
{
- abstract override def +(element: A): Buffer[A] = {
- super.+(element);
- publish(new Include(Pair(End, element)) with Undoable {
- def undo: Unit = trimEnd(1);
- });
- this
- }
+ abstract override def +(element: A): Buffer[A] = {
+ super.+(element)
+ publish(new Include(Pair(End, element)) with Undoable {
+ def undo: Unit = trimEnd(1)
+ })
+ this
+ }
- abstract override def +:(element: A): Buffer[A] = {
- super.+:(element);
- publish(new Include(Pair(Start, element)) with Undoable {
- def undo: Unit = trimStart(1);
- });
- this
- }
+ abstract override def +:(element: A): Buffer[A] = {
+ super.+:(element);
+ publish(new Include(Pair(Start, element)) with Undoable {
+ def undo: Unit = trimStart(1)
+ })
+ this
+ }
- abstract override def insertAll(n: Int, iter: Iterable[A]): Unit = {
- super.insertAll(n, iter);
- var i = n;
- val it = iter.elements;
- while (it.hasNext) {
- publish(new Include(Pair(Index(i), it.next)) with Undoable {
- def undo: Unit = remove(i);
- });
- i = i + 1;
- }
+ abstract override def insertAll(n: Int, iter: Iterable[A]): Unit = {
+ super.insertAll(n, iter)
+ var i = n
+ val it = iter.elements
+ while (it.hasNext) {
+ publish(new Include(Pair(Index(i), it.next)) with Undoable {
+ def undo: Unit = remove(i);
+ })
+ i = i + 1
}
+ }
- abstract override def update(n: Int, newelement: A): Unit = {
- val oldelement = apply(n);
- super.update(n, newelement);
- publish(new Update(Pair(Index(n), newelement)) with Undoable {
- def undo: Unit = update(n, oldelement);
- });
- }
+ abstract override def update(n: Int, newelement: A): Unit = {
+ val oldelement = apply(n)
+ super.update(n, newelement)
+ publish(new Update(Pair(Index(n), newelement)) with Undoable {
+ def undo: Unit = update(n, oldelement)
+ })
+ }
- abstract override def remove(n: Int): A = {
- val oldelement = apply(n);
- super.remove(n);
- publish(new Remove(Pair(Index(n), oldelement)) with Undoable {
- def undo: Unit = insert(n, oldelement);
- });
- oldelement
- }
+ abstract override def remove(n: Int): A = {
+ val oldelement = apply(n)
+ super.remove(n)
+ publish(new Remove(Pair(Index(n), oldelement)) with Undoable {
+ def undo: Unit = insert(n, oldelement)
+ })
+ oldelement
+ }
- abstract override def clear: Unit = {
- super.clear;
- publish(new Reset with Undoable { def undo: Unit = error("cannot undo"); });
- }
+ abstract override def clear: Unit = {
+ super.clear
+ publish(new Reset with Undoable { def undo: Unit = error("cannot undo") })
+ }
}