diff options
author | michelou <michelou@epfl.ch> | 2003-06-25 14:17:52 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2003-06-25 14:17:52 +0000 |
commit | 6a0cdb58213674b2b9787448db41984fe7ad493b (patch) | |
tree | bac2b3e4dc558a1de3de640d80f36010cb3c745e | |
parent | a8722061eee0cb300a32ea30484a267ec6004368 (diff) | |
download | scala-6a0cdb58213674b2b9787448db41984fe7ad493b.tar.gz scala-6a0cdb58213674b2b9787448db41984fe7ad493b.tar.bz2 scala-6a0cdb58213674b2b9787448db41984fe7ad493b.zip |
removed tabs
-rw-r--r-- | sources/scala/SingleLinkedList.scala | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/sources/scala/SingleLinkedList.scala b/sources/scala/SingleLinkedList.scala index b7e4934de0..5fd2fe937c 100644 --- a/sources/scala/SingleLinkedList.scala +++ b/sources/scala/SingleLinkedList.scala @@ -4,27 +4,29 @@ ** __\ \/ /__/ __ |/ /__/ __ | ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** -** $Id$ \* */ +// $Id$ + + package scala; abstract class SingleLinkedList[A, This <: SingleLinkedList[A, This]]: This with Seq[A] { - var elem: A = _; + var elem: A = _; - var next: This = _; + var next: This = _; - def length: Int = 1 + (if (next == null) 0 else next.length); + def length: Int = 1 + (if (next == null) 0 else next.length); - def append(that: This): Unit = - if (next == null) { next = that; } else next.append(that); + def append(that: This): Unit = + if (next == null) { next = that; } else next.append(that); - def insert(that: This): Unit = if (that != null) { - that.append(next); - next = that; - } + def insert(that: This): Unit = if (that != null) { + that.append(next); + next = that; + } def apply(n: Int): A = { if (n == 0) elem @@ -52,4 +54,5 @@ abstract class SingleLinkedList[A, This <: SingleLinkedList[A, This]]: This with def toList: List[A] = if (next == null) (elem :: Nil) else (elem :: next.toList); + } |