summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2007-02-20 16:37:44 +0000
committermichelou <michelou@epfl.ch>2007-02-20 16:37:44 +0000
commit4362112a7e58271a50f3218248d8ef47af5cd408 (patch)
tree5e33db8c783b2f02361fcf4eb28a9b2cf273cf6d
parentc71d5e24e64f88ee6f502326674b6b55025fcded (diff)
downloadscala-4362112a7e58271a50f3218248d8ef47af5cd408.tar.gz
scala-4362112a7e58271a50f3218248d8ef47af5cd408.tar.bz2
scala-4362112a7e58271a50f3218248d8ef47af5cd408.zip
updated annotations in Scala library
-rw-r--r--src/actors/scala/actors/remote/Serializer.scala12
-rw-r--r--src/library/scala/BigInt.scala4
-rw-r--r--src/library/scala/Iterable.scala5
-rw-r--r--src/library/scala/IterableProxy.scala5
-rw-r--r--src/library/scala/Iterator.scala7
-rw-r--r--src/library/scala/List.scala8
-rw-r--r--src/library/scala/Option.scala16
-rw-r--r--src/library/scala/ScalaObject.scala6
-rw-r--r--src/library/scala/Seq.scala8
-rw-r--r--src/library/scala/SeqProxy.scala7
-rw-r--r--src/library/scala/collection/immutable/BitSet.scala6
-rwxr-xr-xsrc/library/scala/collection/immutable/EmptyMap.scala4
-rwxr-xr-xsrc/library/scala/collection/immutable/EmptySet.scala4
-rwxr-xr-xsrc/library/scala/collection/immutable/HashMap.scala6
-rwxr-xr-xsrc/library/scala/collection/immutable/HashSet.scala7
-rw-r--r--src/library/scala/collection/immutable/ListMap.scala9
-rw-r--r--src/library/scala/collection/immutable/ListSet.scala11
-rw-r--r--src/library/scala/collection/immutable/Map.scala22
-rwxr-xr-xsrc/library/scala/collection/immutable/Map1.scala5
-rwxr-xr-xsrc/library/scala/collection/immutable/Map2.scala4
-rwxr-xr-xsrc/library/scala/collection/immutable/Map3.scala4
-rwxr-xr-xsrc/library/scala/collection/immutable/Map4.scala4
-rw-r--r--src/library/scala/collection/immutable/Queue.scala6
-rwxr-xr-xsrc/library/scala/collection/immutable/RedBlack.scala22
-rw-r--r--src/library/scala/collection/immutable/Set.scala38
-rwxr-xr-xsrc/library/scala/collection/immutable/Set1.scala4
-rwxr-xr-xsrc/library/scala/collection/immutable/Set2.scala4
-rwxr-xr-xsrc/library/scala/collection/immutable/Set3.scala4
-rwxr-xr-xsrc/library/scala/collection/immutable/Set4.scala4
-rw-r--r--src/library/scala/collection/immutable/Stack.scala6
-rw-r--r--src/library/scala/collection/immutable/Tree.scala8
-rw-r--r--src/library/scala/collection/immutable/TreeMap.scala9
-rw-r--r--src/library/scala/collection/immutable/TreeSet.scala9
-rwxr-xr-xsrc/library/scala/collection/immutable/UnbalancedTreeMap.scala6
-rw-r--r--src/library/scala/collection/mutable/ArrayBuffer.scala6
-rw-r--r--src/library/scala/collection/mutable/BitSet.scala4
-rw-r--r--src/library/scala/collection/mutable/Buffer.scala9
-rwxr-xr-xsrc/library/scala/collection/mutable/DefaultEntry.scala6
-rw-r--r--src/library/scala/collection/mutable/HashMap.scala6
-rw-r--r--src/library/scala/collection/mutable/HashSet.scala6
-rw-r--r--src/library/scala/collection/mutable/History.scala6
-rw-r--r--src/library/scala/collection/mutable/ImmutableMapAdaptor.scala6
-rw-r--r--src/library/scala/collection/mutable/ImmutableSetAdaptor.scala6
-rw-r--r--src/library/scala/collection/mutable/LinkedList.scala6
-rw-r--r--src/library/scala/collection/mutable/Map.scala27
-rw-r--r--src/library/scala/collection/mutable/MapProxy.scala13
-rw-r--r--src/library/scala/collection/mutable/PriorityQueue.scala9
-rw-r--r--src/library/scala/collection/mutable/Queue.scala6
-rw-r--r--src/library/scala/collection/mutable/RevertableHistory.scala6
-rw-r--r--src/library/scala/collection/mutable/Set.scala15
-rw-r--r--src/library/scala/collection/mutable/SetProxy.scala7
-rw-r--r--src/library/scala/collection/mutable/Stack.scala13
-rw-r--r--src/library/scala/collection/mutable/SynchronizedMap.scala19
-rw-r--r--src/library/scala/collection/mutable/SynchronizedSet.scala7
-rw-r--r--src/library/scala/runtime/BoxedAnyArray.scala6
-rw-r--r--src/library/scala/runtime/BoxedBooleanArray.scala6
-rw-r--r--src/library/scala/runtime/BoxedByteArray.scala6
-rw-r--r--src/library/scala/runtime/BoxedCharArray.scala30
-rw-r--r--src/library/scala/runtime/BoxedDoubleArray.scala6
-rw-r--r--src/library/scala/runtime/BoxedFloatArray.scala6
-rw-r--r--src/library/scala/runtime/BoxedIntArray.scala6
-rw-r--r--src/library/scala/runtime/BoxedLongArray.scala6
-rw-r--r--src/library/scala/runtime/BoxedObjectArray.scala6
-rw-r--r--src/library/scala/runtime/BoxedShortArray.scala6
-rw-r--r--src/library/scala/runtime/StringAdd.scala5
-rw-r--r--src/library/scala/xml/Atom.scala4
-rw-r--r--src/library/scala/xml/Group.scala4
-rw-r--r--src/library/scala/xml/MetaData.scala7
-rw-r--r--src/library/scala/xml/NamespaceBinding.scala6
-rw-r--r--src/library/scala/xml/dtd/ContentModel.scala123
-rw-r--r--src/library/scala/xml/parsing/ValidatingMarkupHandler.scala78
71 files changed, 413 insertions, 365 deletions
diff --git a/src/actors/scala/actors/remote/Serializer.scala b/src/actors/scala/actors/remote/Serializer.scala
index e3c9c1236e..2532e63dfe 100644
--- a/src/actors/scala/actors/remote/Serializer.scala
+++ b/src/actors/scala/actors/remote/Serializer.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2005-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -20,7 +20,7 @@ abstract class Serializer(val service: Service) {
def serialize(o: AnyRef): Array[byte]
def deserialize(a: Array[byte]): AnyRef
- [throws(classOf[IOException])]
+ @throws(classOf[IOException])
def readBytes(inputStream: DataInputStream): Array[byte] = {
try {
val length = inputStream.readInt()
@@ -34,13 +34,13 @@ abstract class Serializer(val service: Service) {
}
}
- [throws(classOf[IOException]), throws(classOf[ClassNotFoundException])]
+ @throws(classOf[IOException]) @throws(classOf[ClassNotFoundException])
def readObject(inputStream: DataInputStream): AnyRef = {
val bytes = readBytes(inputStream)
deserialize(bytes)
}
- [throws(classOf[IOException])]
+ @throws(classOf[IOException])
def writeBytes(outputStream: DataOutputStream, bytes: Array[byte]): unit = {
val length = bytes.length;
// original length
@@ -49,7 +49,7 @@ abstract class Serializer(val service: Service) {
outputStream.flush()
}
- [throws(classOf[IOException])]
+ @throws(classOf[IOException])
def writeObject(outputStream: DataOutputStream, obj: AnyRef) = {
val bytes = serialize(obj)
writeBytes(outputStream, bytes)
diff --git a/src/library/scala/BigInt.scala b/src/library/scala/BigInt.scala
index 9be8a45dbd..81f82ab662 100644
--- a/src/library/scala/BigInt.scala
+++ b/src/library/scala/BigInt.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2006-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -113,7 +113,7 @@ object BigInt {
* @author Martin Odersky
* @version 1.0, 15/07/2003
*/
-[serializable]
+@serializable
class BigInt(val bigInteger: BigInteger) extends runtime.BoxedNumber {
/** Returns the hash code for this BigInt. */
diff --git a/src/library/scala/Iterable.scala b/src/library/scala/Iterable.scala
index 95c9294597..e4c2e99810 100644
--- a/src/library/scala/Iterable.scala
+++ b/src/library/scala/Iterable.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -93,7 +93,8 @@ trait Iterable[+A] {
* @return the new iterable object
* @deprecated use <code>++</code> instead
*/
- [deprecated] def concat[B >: A](that: Iterable[B]): Iterable[B] =
+ @deprecated
+ def concat[B >: A](that: Iterable[B]): Iterable[B] =
this ++ that
/** Appends two iterable objects.
diff --git a/src/library/scala/IterableProxy.scala b/src/library/scala/IterableProxy.scala
index a69fc91dd4..486108e930 100644
--- a/src/library/scala/IterableProxy.scala
+++ b/src/library/scala/IterableProxy.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -26,7 +26,8 @@ trait IterableProxy[+A] extends Iterable[A] with Proxy {
def self: Iterable[A]
override def elements: Iterator[A] = self.elements
- [deprecated] override def concat [B >: A](that: Iterable[B]): Iterable[B] = self concat that
+ @deprecated
+ override def concat [B >: A](that: Iterable[B]): Iterable[B] = self concat that
override def map[B](f: A => B): Iterable[B] = self map f
override def flatMap[B](f: A => Iterable[B]): Iterable[B] = self flatMap f
override def filter(p: A => Boolean): Iterable[A] = self filter p
diff --git a/src/library/scala/Iterator.scala b/src/library/scala/Iterator.scala
index 00e40ab5b9..4dd5d46433 100644
--- a/src/library/scala/Iterator.scala
+++ b/src/library/scala/Iterator.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -95,7 +95,8 @@ object Iterator {
/**
* @deprecated use <code>fromProduct</code> instead.
*/
- [deprecated] def fromCaseClass(n: Product) = fromProduct(n)
+ @deprecated
+ def fromCaseClass(n: Product) = fromProduct(n)
/** Create an iterator with elements
* <code>e<sub>n+1</sub> = e<sub>n</sub> + 1</code>
diff --git a/src/library/scala/List.scala b/src/library/scala/List.scala
index 4e01ee2107..b45292caa2 100644
--- a/src/library/scala/List.scala
+++ b/src/library/scala/List.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -1137,7 +1137,7 @@ sealed abstract class List[+a] extends Seq[a] {
* @author Martin Odersky
* @version 1.0, 15/07/2003
*/
-[SerialVersionUID(0 - 8256821097970055419L)]
+@SerialVersionUID(0 - 8256821097970055419L)
case object Nil extends List[Nothing] {
override def isEmpty = true
def head: Nothing =
@@ -1151,7 +1151,7 @@ case object Nil extends List[Nothing] {
* @author Martin Odersky
* @version 1.0, 15/07/2003
*/
-[SerialVersionUID(0L - 8476791151983527571L)]
+@SerialVersionUID(0L - 8476791151983527571L)
final case class ::[b](hd: b, private[scala] var tl: List[b]) extends List[b] {
def head = hd
def tail = tl
diff --git a/src/library/scala/Option.scala b/src/library/scala/Option.scala
index 46b659caac..4a72a44511 100644
--- a/src/library/scala/Option.scala
+++ b/src/library/scala/Option.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -45,14 +45,17 @@ sealed abstract class Option[+A] extends Product {
*/
def get: A
- /** @deprecated; use getOrElse instead */
- [deprecated] def get[B >: A](default: B): B = this match {
+ /** @deprecated; use <code>getOrElse</code> instead
+ */
+ @deprecated
+ def get[B >: A](default: B): B = this match {
case None => default
case Some(x) => x
}
/** If the option is nonempty return its value,
* otherwise return the result of evaluating a default expression.
+ *
* @param default the default expression.
*/
def getOrElse[B >: A](default: => B): B =
@@ -60,7 +63,8 @@ sealed abstract class Option[+A] extends Product {
/** If the option is nonempty, return a function applied to its value,
* wrapped in a Some i.e. <code>Some(f(this.get))</code>.
- * Otherwise return None.
+ * Otherwise return <code>None</code>.
+ *
* @param f the function to apply
*/
def map[B](f: A => B): Option[B] =
@@ -76,6 +80,7 @@ sealed abstract class Option[+A] extends Product {
/** If the option is nonempty and the given predicate <code>p</code>
* yields <code>false</code> on its value, return <code>None</code>.
* Otherwise return the option value itself.
+ *
* @param p the predicate used for testing.
*/
def filter(p: A => Boolean): Option[A] =
@@ -83,6 +88,7 @@ sealed abstract class Option[+A] extends Product {
/** Apply the given procedure <code>f</code> to the option's value,
* if it is nonempty. Do nothing if it is empty.
+ *
* @param f the procedure to apply.
*/
def foreach(f: A => Unit) {
diff --git a/src/library/scala/ScalaObject.scala b/src/library/scala/ScalaObject.scala
index 7d213e33b3..9979343397 100644
--- a/src/library/scala/ScalaObject.scala
+++ b/src/library/scala/ScalaObject.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -17,7 +17,7 @@ trait ScalaObject extends AnyRef {
/** This method is needed for optimizing pattern matching expressions
* which match on constructors of case classes.
*/
- [remote]
+ @remote
def $tag(): Int = 0
}
diff --git a/src/library/scala/Seq.scala b/src/library/scala/Seq.scala
index 1a488b82b2..19616c97c3 100644
--- a/src/library/scala/Seq.scala
+++ b/src/library/scala/Seq.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -90,7 +90,8 @@ trait Seq[+A] extends AnyRef with PartialFunction[Int, A] with Iterable[A] {
* @return the new iterable object
* @deprecated use <code>++</code> instead
*/
- [deprecated] override def concat [B >: A](that: Iterable[B]): Seq[B] = {
+ @deprecated
+ override def concat [B >: A](that: Iterable[B]): Seq[B] = {
val buf = new ArrayBuffer[B]
this copyToBuffer buf
that copyToBuffer buf
@@ -242,7 +243,8 @@ trait Seq[+A] extends AnyRef with PartialFunction[Int, A] with Iterable[A] {
*
* @deprecated use <code>slice</code> instead
*/
- [deprecated] def subseq(from: Int, end: Int): Seq[A] = slice(from, end - from)
+ @deprecated
+ def subseq(from: Int, end: Int): Seq[A] = slice(from, end - from)
/** Converts this sequence to a fresh Array with <code>length</code> elements.
*/
diff --git a/src/library/scala/SeqProxy.scala b/src/library/scala/SeqProxy.scala
index 5af95e0953..28878f7d18 100644
--- a/src/library/scala/SeqProxy.scala
+++ b/src/library/scala/SeqProxy.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -26,7 +26,8 @@ trait SeqProxy[+A] extends Seq[A] with IterableProxy[A] {
override def apply(i: Int): A = self(i)
override def length: Int = self.length
override def isEmpty: Boolean = self.isEmpty
- [deprecated] override def concat [B >: A](that: Iterable[B]): Seq[B] = self concat that
+ @deprecated
+ override def concat [B >: A](that: Iterable[B]): Seq[B] = self concat that
override def isDefinedAt(x: Int): Boolean = self isDefinedAt x
override def lastIndexOf[B >: A](elem: B): Int = self lastIndexOf elem
override def map[B](f: A => B): Seq[B] = self map f
diff --git a/src/library/scala/collection/immutable/BitSet.scala b/src/library/scala/collection/immutable/BitSet.scala
index b2d50c329f..6e33e43899 100644
--- a/src/library/scala/collection/immutable/BitSet.scala
+++ b/src/library/scala/collection/immutable/BitSet.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -27,7 +27,7 @@ package scala.collection.immutable
* @version 1.0
*/
-[serializable]
+@serializable
/*
* This is a strange class! It claims to be immutable but is not.
* It claims to be a BitSet but it is not a Set.
diff --git a/src/library/scala/collection/immutable/EmptyMap.scala b/src/library/scala/collection/immutable/EmptyMap.scala
index 127781f2d5..d6d4b8aec3 100755
--- a/src/library/scala/collection/immutable/EmptyMap.scala
+++ b/src/library/scala/collection/immutable/EmptyMap.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -18,7 +18,7 @@ import Predef.Pair
* @author Martin Oderskty
* @version 1.0, 019/01/2007
*/
-[serializable]
+@serializable
class EmptyMap[A, +B] extends Map[A, B] {
def size: Int = 0
diff --git a/src/library/scala/collection/immutable/EmptySet.scala b/src/library/scala/collection/immutable/EmptySet.scala
index 83a4f77813..b70fe38f05 100755
--- a/src/library/scala/collection/immutable/EmptySet.scala
+++ b/src/library/scala/collection/immutable/EmptySet.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -16,7 +16,7 @@ package scala.collection.immutable
* @author Martin Oderskty
* @version 1.0, 019/01/2007
*/
-[serializable]
+@serializable
class EmptySet[A] extends Set[A] {
def empty[C]: Set[C] = new EmptySet[C]
diff --git a/src/library/scala/collection/immutable/HashMap.scala b/src/library/scala/collection/immutable/HashMap.scala
index 57fc4b8ed9..b708c15203 100755
--- a/src/library/scala/collection/immutable/HashMap.scala
+++ b/src/library/scala/collection/immutable/HashMap.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -28,7 +28,7 @@ object HashMap {
def apply[A, B](elems: Pair[A, B]*) = empty[A, B] ++ elems
}
-[serializable]
+@serializable
class HashMap[A, B] extends Map[A,B] with mutable.HashTable[A] {
type Entry = mutable.DefaultEntry[A, Any]
diff --git a/src/library/scala/collection/immutable/HashSet.scala b/src/library/scala/collection/immutable/HashSet.scala
index aa4d832537..9adf05567f 100755
--- a/src/library/scala/collection/immutable/HashSet.scala
+++ b/src/library/scala/collection/immutable/HashSet.scala
@@ -1,12 +1,13 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
// $Id: HashSet.scala 9554 2007-01-04 16:30:16 +0000 (Thu, 04 Jan 2007) odersky $
+
package scala.collection.immutable
object HashSet {
@@ -20,7 +21,7 @@ object HashSet {
def apply[A, B](elems: A*) = empty[A] ++ elems
}
-[serializable]
+@serializable
class HashSet[A] extends Set[A] with mutable.FlatHashTable[A] {
protected var later: HashSet[A] = null
protected var changedElem: A = _
diff --git a/src/library/scala/collection/immutable/ListMap.scala b/src/library/scala/collection/immutable/ListMap.scala
index c3fdfe1a80..9d67709ae1 100644
--- a/src/library/scala/collection/immutable/ListMap.scala
+++ b/src/library/scala/collection/immutable/ListMap.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -17,7 +17,8 @@ object ListMap {
/** The empty map of this type
* @deprecated use <code>empty</code> instead
*/
- [deprecated] def Empty[A, B] = new ListMap[A, B]
+ @deprecated
+ def Empty[A, B] = new ListMap[A, B]
/** The empty map of this type */
def empty[A, B] = new ListMap[A, B]
@@ -36,7 +37,7 @@ object ListMap {
* @author Martin Oderskty
* @version 2.0, 01/01/2007
*/
-[serializable]
+@serializable
class ListMap[A, +B] extends Map[A, B] {
/** Returns a <code>new ListMap</code> instance mapping keys of the
@@ -92,7 +93,7 @@ class ListMap[A, +B] extends Map[A, B] {
protected def value: B = throw new NoSuchElementException("empty map")
protected def next: ListMap[A, B] = throw new NoSuchElementException("empty map")
- [serializable]
+ @serializable
protected class Node[B1 >: B](override protected val key: A,
override protected val value: B1) extends ListMap[A, B1] {
/** Returns the number of mappings in this map.
diff --git a/src/library/scala/collection/immutable/ListSet.scala b/src/library/scala/collection/immutable/ListSet.scala
index e869e6258d..8e801fe215 100644
--- a/src/library/scala/collection/immutable/ListSet.scala
+++ b/src/library/scala/collection/immutable/ListSet.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -19,7 +19,8 @@ object ListSet {
/** constructs an empty ListSet
* @deprecated use <code>empty</code> instead
*/
- [deprecated] def Empty[A] = new ListSet[A]
+ @deprecated
+ def Empty[A] = new ListSet[A]
/** The empty set of this type.
*/
@@ -39,7 +40,7 @@ object ListSet {
* @author Matthias Zenger
* @version 1.0, 09/07/2003
*/
-[serializable]
+@serializable
class ListSet[A] extends AnyRef with Set[A] {
/** Returns the number of elements in this set.
@@ -101,7 +102,7 @@ class ListSet[A] extends AnyRef with Set[A] {
*/
protected def next: ListSet[A] = throw new NoSuchElementException("Next of an empty set");
- [serializable]
+ @serializable
protected class Node(override protected val elem: A) extends ListSet[A] {
/** Returns the number of elements in this set.
*
diff --git a/src/library/scala/collection/immutable/Map.scala b/src/library/scala/collection/immutable/Map.scala
index 65b0df4979..1fe98d41ea 100644
--- a/src/library/scala/collection/immutable/Map.scala
+++ b/src/library/scala/collection/immutable/Map.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -183,7 +183,7 @@ trait Map[A, +B] extends collection.Map[A, B] {
* </pre>
* @deprecated use <code>+({A, B})</code> instead
*/
- [deprecated] def +(key: A): MapTo = new MapTo(key)
+ @deprecated def +(key: A): MapTo = new MapTo(key)
/** <code>incl</code> can be used to add many mappings at the same time
* to the map. The method assumes that a mapping is represented
@@ -194,7 +194,7 @@ trait Map[A, +B] extends collection.Map[A, B] {
* @return ...
* @deprecated use <code>+</code> instead
*/
- [deprecated] def incl[B1 >: B](mappings: Pair[A, B1]*): Map[A, B1] = incl(mappings)
+ @deprecated def incl[B1 >: B](mappings: Pair[A, B1]*): Map[A, B1] = incl(mappings)
/** <code>incl</code> can be used to add many mappings at the same time
* to the map. The method assumes that each mapping is represented
@@ -203,7 +203,7 @@ trait Map[A, +B] extends collection.Map[A, B] {
*
* @deprecated use <code>++</code> instead
*/
- [deprecated] def incl[B1 >: B](map: Iterable[Pair[A, B1]]): Map[A, B1] = {
+ @deprecated def incl[B1 >: B](map: Iterable[Pair[A, B1]]): Map[A, B1] = {
val iter = map.elements
var res: Map[A, B1] = this
while (iter.hasNext) {
@@ -218,8 +218,9 @@ trait Map[A, +B] extends collection.Map[A, B] {
*
* @param keys ...
* @return the updated map
- * @deprecated use <code>-</code> instead */
- [deprecated] def excl(keys: A*): Map[A, B] = excl(keys)
+ * @deprecated use <code>-</code> instead
+ */
+ @deprecated def excl(keys: A*): Map[A, B] = excl(keys)
/** This method removes all the mappings for keys provided by an
* iterator over the elements of the <code>keys</code> object.
@@ -228,7 +229,7 @@ trait Map[A, +B] extends collection.Map[A, B] {
* @return the updated map
* @deprecated use <code>--</code> instead
*/
- [deprecated] def excl(keys: Iterable[A]): Map[A, B] = {
+ @deprecated def excl(keys: Iterable[A]): Map[A, B] = {
val iter = keys.elements
var res = this
while (iter.hasNext) {
@@ -243,11 +244,12 @@ trait Map[A, +B] extends collection.Map[A, B] {
* @param p ...
* @return the string representation of a map entry
*/
- [deprecated] def mappingToString[B1 >: B](p: Pair[A, B1]) = p._1.toString() + " -> " + p._2
+ @deprecated def mappingToString[B1 >: B](p: Pair[A, B1]) =
+ p._1.toString() + " -> " + p._2
/** @deprecated use <code>+({A, B})</code> instead
*/
- [deprecated] class MapTo(key: A) {
+ @deprecated class MapTo(key: A) {
def -> [B1 >: B](value: B1) = update(key, value)
}
}
diff --git a/src/library/scala/collection/immutable/Map1.scala b/src/library/scala/collection/immutable/Map1.scala
index edd8dc11fc..82d3ab4d3d 100755
--- a/src/library/scala/collection/immutable/Map1.scala
+++ b/src/library/scala/collection/immutable/Map1.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -15,10 +15,11 @@ package scala.collection.immutable
import Predef.Pair
/** This class implements empty immutable maps
+ *
* @author Martin Oderskty
* @version 1.0, 019/01/2007
*/
-[serializable]
+@serializable
class Map1[A, +B](key1: A, value1: B) extends Map[A, B] {
def size = 1
diff --git a/src/library/scala/collection/immutable/Map2.scala b/src/library/scala/collection/immutable/Map2.scala
index 02d4651d03..dbde4b1fb5 100755
--- a/src/library/scala/collection/immutable/Map2.scala
+++ b/src/library/scala/collection/immutable/Map2.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -18,7 +18,7 @@ import Predef.Pair
* @author Martin Oderskty
* @version 1.0, 019/01/2007
*/
-[serializable]
+@serializable
class Map2[A, +B](key1: A, value1: B, key2: A, value2: B) extends Map[A, B] {
def size = 2
diff --git a/src/library/scala/collection/immutable/Map3.scala b/src/library/scala/collection/immutable/Map3.scala
index b7c4a506f8..7a743b1668 100755
--- a/src/library/scala/collection/immutable/Map3.scala
+++ b/src/library/scala/collection/immutable/Map3.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -18,7 +18,7 @@ import Predef.Pair
* @author Martin Oderskty
* @version 1.0, 019/01/2007
*/
-[serializable]
+@serializable
class Map3[A, +B](key1: A, value1: B, key2: A, value2: B, key3: A, value3: B) extends Map[A, B] {
def size = 3
diff --git a/src/library/scala/collection/immutable/Map4.scala b/src/library/scala/collection/immutable/Map4.scala
index 1582123c18..e85a85868c 100755
--- a/src/library/scala/collection/immutable/Map4.scala
+++ b/src/library/scala/collection/immutable/Map4.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -16,7 +16,7 @@ import Predef._
* @author Martin Oderskty
* @version 1.0, 019/01/2007
*/
-[serializable]
+@serializable
class Map4[A, +B](key1: A, value1: B, key2: A, value2: B, key3: A, value3: B, key4: A, value4: B) extends Map[A, B] {
def size = 4
diff --git a/src/library/scala/collection/immutable/Queue.scala b/src/library/scala/collection/immutable/Queue.scala
index c40777b417..3f294cd055 100644
--- a/src/library/scala/collection/immutable/Queue.scala
+++ b/src/library/scala/collection/immutable/Queue.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -24,7 +24,7 @@ object Queue {
* @author Erik Stenman
* @version 1.0, 08/07/2003
*/
-[serializable]
+@serializable
class Queue[+A](elem: A*) extends Seq[A] {
protected val in: List[A] = Nil
diff --git a/src/library/scala/collection/immutable/RedBlack.scala b/src/library/scala/collection/immutable/RedBlack.scala
index dd3c7ebc94..976f149b7a 100755
--- a/src/library/scala/collection/immutable/RedBlack.scala
+++ b/src/library/scala/collection/immutable/RedBlack.scala
@@ -1,6 +1,16 @@
+/* __ *\
+** ________ ___ / / ___ Scala API **
+** / __/ __// _ | / / / _ | (c) 2005-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
+** /____/\___/_/ |_/____/_/ | | **
+** |/ **
+\* */
+
+// $Id: $
+
package scala.collection.immutable
-[serializable]
+@serializable
abstract class RedBlack[A] {
def isSmaller(x: A, y: A): boolean
@@ -12,7 +22,7 @@ abstract class RedBlack[A] {
private def mkTree[B](isBlack: boolean, k: A, v: B, l: Tree[B], r: Tree[B]) =
if (isBlack) BlackTree(k, v, l, r) else RedTree(k, v, l, r)
- [serializable]
+ @serializable
abstract class Tree[+B] {
def isEmpty: boolean
def isBlack: boolean
@@ -24,7 +34,7 @@ abstract class RedBlack[A] {
def del(k: A): Tree[B]
def smallest: NonEmpty[B]
}
- [serializable]
+ @serializable
abstract class NonEmpty[+B] extends Tree[B] {
def isEmpty = false
def key: A
@@ -70,7 +80,7 @@ abstract class RedBlack[A] {
def elements: Iterator[Pair[A, B]] =
left.elements append Iterator.single(Pair(key, value)) append right.elements
}
- [serializable]
+ @serializable
case object Empty extends Tree[Nothing] {
def isEmpty = true
def isBlack = true
@@ -80,14 +90,14 @@ abstract class RedBlack[A] {
def smallest: NonEmpty[Nothing] = throw new NoSuchElementException("empty map")
def elements: Iterator[Pair[A, Nothing]] = Iterator.empty
}
- [serializable]
+ @serializable
case class RedTree[+B](override val key: A,
override val value: B,
override val left: Tree[B],
override val right: Tree[B]) extends NonEmpty[B] {
def isBlack = false
}
- [serializable]
+ @serializable
case class BlackTree[+B](override val key: A,
override val value: B,
override val left: Tree[B],
diff --git a/src/library/scala/collection/immutable/Set.scala b/src/library/scala/collection/immutable/Set.scala
index 4aa51755c4..0d78403385 100644
--- a/src/library/scala/collection/immutable/Set.scala
+++ b/src/library/scala/collection/immutable/Set.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -12,17 +12,19 @@
package scala.collection.immutable
-/** This class represents immutable sets. Concrete set implementations
- * just have to provide functionality for the abstract methods in
- * <code>scala.collection.Set</code> as well as for <code>+</code> and
- * <code>-</code>.
+/** <p>
+ * This class represents immutable sets. Concrete set implementations
+ * just have to provide functionality for the abstract methods in
+ * <code>scala.collection.Set</code> as well as for <code>+</code> and
+ * <code>-</code>.
+ * </p>
+ * <p>
+ * Note that abstract immutable.Set's are not covariant in their type
+ * parameter. This is because some subclasses cannot support the
+ * <code>+</code> method for arbitrary types.
+ * </p>
*
- * Note that abstract immutable.Set's are not covariant in their type
- * parameter. This is because some subclasses cannot support the
- * <code>+</code> method for arbitrary types.
- *
- * @author Matthias Zenger
- * @author Martin Odersky
+ * @author Matthias Zenger, Martin Odersky
* @version 1.1, 03/05/2004
*/
object Set {
@@ -73,14 +75,16 @@ trait Set[A] extends AnyRef with collection.Set[A] {
/** <code>incl</code> can be used to add many elements to the set
* at the same time.
*/
- [deprecated] def incl(elems: A*): Set[A] = incl(elems)
+ @deprecated
+ def incl(elems: A*): Set[A] = incl(elems)
/** This method will add all the elements provided by an iterator
* of the iterable object <code>that</code> to the set.
*
* @param that ...
*/
- [deprecated] def incl(that: Iterable[A]): Set[A] =
+ @deprecated
+ def incl(that: Iterable[A]): Set[A] =
that.foldLeft(this)((set, elem) => set + elem)
/** Remove a single element from a set.
@@ -116,12 +120,14 @@ trait Set[A] extends AnyRef with collection.Set[A] {
/** <code>excl</code> removes many elements from the set.
*/
- [deprecated] def excl(elems: A*): Set[A] = excl(elems)
+ @deprecated
+ def excl(elems: A*): Set[A] = excl(elems)
/** This method removes all the elements provided by an iterator
* of the iterable object <code>that</code> from the set.
*/
- [deprecated] def excl(that: Iterable[A]): Set[A] =
+ @deprecated
+ def excl(that: Iterable[A]): Set[A] =
that.foldLeft(this)((set, elem) => set - elem)
/** This method computes an intersection with set <code>that</code>.
diff --git a/src/library/scala/collection/immutable/Set1.scala b/src/library/scala/collection/immutable/Set1.scala
index 86d5c1d275..423acc68be 100755
--- a/src/library/scala/collection/immutable/Set1.scala
+++ b/src/library/scala/collection/immutable/Set1.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -16,7 +16,7 @@ package scala.collection.immutable
* @author Martin Oderskty
* @version 1.0, 019/01/2007
*/
-[serializable]
+@serializable
class Set1[A](elem1: A) extends Set[A] {
def empty[C]: Set[C] = new EmptySet[C]
diff --git a/src/library/scala/collection/immutable/Set2.scala b/src/library/scala/collection/immutable/Set2.scala
index 20ddd6a43d..5e15f34d68 100755
--- a/src/library/scala/collection/immutable/Set2.scala
+++ b/src/library/scala/collection/immutable/Set2.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -16,7 +16,7 @@ package scala.collection.immutable
* @author Martin Oderskty
* @version 1.0, 019/01/2007
*/
-[serializable]
+@serializable
class Set2[A](elem1: A, elem2: A) extends Set[A] {
def empty[C]: Set[C] = new EmptySet[C]
diff --git a/src/library/scala/collection/immutable/Set3.scala b/src/library/scala/collection/immutable/Set3.scala
index 1ffcc833df..b4f3a697d8 100755
--- a/src/library/scala/collection/immutable/Set3.scala
+++ b/src/library/scala/collection/immutable/Set3.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -16,7 +16,7 @@ package scala.collection.immutable
* @author Martin Oderskty
* @version 1.0, 019/01/2007
*/
-[serializable]
+@serializable
class Set3[A](elem1: A, elem2: A, elem3: A) extends Set[A] {
def empty[C]: Set[C] = new EmptySet[C]
diff --git a/src/library/scala/collection/immutable/Set4.scala b/src/library/scala/collection/immutable/Set4.scala
index a51ad8d546..7d83277bf8 100755
--- a/src/library/scala/collection/immutable/Set4.scala
+++ b/src/library/scala/collection/immutable/Set4.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -16,7 +16,7 @@ package scala.collection.immutable
* @author Martin Oderskty
* @version 1.0, 019/01/2007
*/
-[serializable]
+@serializable
class Set4[A](elem1: A, elem2: A, elem3: A, elem4: A) extends Set[A] {
def empty[C]: Set[C] = new EmptySet[C]
diff --git a/src/library/scala/collection/immutable/Stack.scala b/src/library/scala/collection/immutable/Stack.scala
index fccf9197ef..4201f7c67e 100644
--- a/src/library/scala/collection/immutable/Stack.scala
+++ b/src/library/scala/collection/immutable/Stack.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -26,7 +26,7 @@ object Stack {
* @author Matthias Zenger
* @version 1.0, 10/07/2003
*/
-[serializable]
+@serializable
class Stack[+A] extends Seq[A] {
/** Checks if this stack is empty.
@@ -121,7 +121,7 @@ class Stack[+A] extends Seq[A] {
override def stringPrefix: String = "Stack"
// Here comes true magic: covariant lists with implicit tail references
- [serializable]
+ @serializable
protected class Node[+B >: A](elem: B) extends Stack[B] {
override def isEmpty: Boolean = false
override def length: Int = Stack.this.length + 1
diff --git a/src/library/scala/collection/immutable/Tree.scala b/src/library/scala/collection/immutable/Tree.scala
index eef8842e39..709ab1224d 100644
--- a/src/library/scala/collection/immutable/Tree.scala
+++ b/src/library/scala/collection/immutable/Tree.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -70,7 +70,7 @@ package scala.collection.immutable
* @version 1.1, 2005-01-20
*/
-[serializable]
+@serializable
abstract class Tree[A <% Ordered[A], B]() extends AnyRef {
/* Data structure:
** - size:Int - the number of elements in the tree.
@@ -252,7 +252,7 @@ private case class INode[A <% Ordered[A],B](t1: GBTree[A,B],
* @author Erik Stenman
* @version 1.0, 2005-01-20
*/
-[serializable]
+@serializable
protected abstract class GBTree[A <% Ordered[A],B] extends AnyRef {
type aNode = GBTree[A,B]
type anInsertTree = InsertTree[A,B]
diff --git a/src/library/scala/collection/immutable/TreeMap.scala b/src/library/scala/collection/immutable/TreeMap.scala
index 9e43f092df..b9078e6bc1 100644
--- a/src/library/scala/collection/immutable/TreeMap.scala
+++ b/src/library/scala/collection/immutable/TreeMap.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -18,7 +18,8 @@ object TreeMap {
/** The empty map of this type
* @deprecated use <code>empty</code> instead
*/
- [deprecated] def Empty[A <% Ordered[A], B] = empty[A, B]
+ @deprecated
+ def Empty[A <% Ordered[A], B] = empty[A, B]
/** The empty map of this type */
def empty[A <% Ordered[A], B] = new TreeMap[A, B]
@@ -34,7 +35,7 @@ object TreeMap {
* @author Matthias Zenger
* @version 1.1, 03/05/2004
*/
-[serializable]
+@serializable
class TreeMap[A <% Ordered[A], +B](val size: int, t: RedBlack[A]#Tree[B])
extends RedBlack[A] with Map[A, B] {
diff --git a/src/library/scala/collection/immutable/TreeSet.scala b/src/library/scala/collection/immutable/TreeSet.scala
index 1226923d66..33c165d3db 100644
--- a/src/library/scala/collection/immutable/TreeSet.scala
+++ b/src/library/scala/collection/immutable/TreeSet.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -16,7 +16,8 @@ object TreeSet {
/** The empty set of this type
* @deprecated use <code>empty</code> instead
*/
- [deprecated] def Empty[A <% Ordered[A]] = empty[A]
+ @deprecated
+ def Empty[A <% Ordered[A]] = empty[A]
/** The empty set of this type
*/
@@ -33,7 +34,7 @@ object TreeSet {
* @version 2.0, 02/01/2007
*/
-[serializable]
+@serializable
class TreeSet[A <% Ordered[A]](val size: int, t: RedBlack[A]#Tree[Unit])
extends RedBlack[A] with Set[A] {
diff --git a/src/library/scala/collection/immutable/UnbalancedTreeMap.scala b/src/library/scala/collection/immutable/UnbalancedTreeMap.scala
index 965c4729c6..cf1817ab64 100755
--- a/src/library/scala/collection/immutable/UnbalancedTreeMap.scala
+++ b/src/library/scala/collection/immutable/UnbalancedTreeMap.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -29,7 +29,7 @@ object UnbalancedTreeMap {
* @version 1.1, 02/01/2007
*/
-[serializable]
+@serializable
class UnbalancedTreeMap[A <% Ordered[A], +B] extends Map[A, B] {
/** A factory to create empty maps of the same type of keys.
diff --git a/src/library/scala/collection/mutable/ArrayBuffer.scala b/src/library/scala/collection/mutable/ArrayBuffer.scala
index f840fc3a2a..e4956b135b 100644
--- a/src/library/scala/collection/mutable/ArrayBuffer.scala
+++ b/src/library/scala/collection/mutable/ArrayBuffer.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -20,7 +20,7 @@ import Predef._
* @author Matthias Zenger
* @version 1.0, 15/03/2004
*/
-[serializable]
+@serializable
class ArrayBuffer[A] extends Buffer[A] with ResizableArray[A] {
/** Appends a single element to this buffer and returns
diff --git a/src/library/scala/collection/mutable/BitSet.scala b/src/library/scala/collection/mutable/BitSet.scala
index 610b86e3ee..455d8e3687 100644
--- a/src/library/scala/collection/mutable/BitSet.scala
+++ b/src/library/scala/collection/mutable/BitSet.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -21,7 +21,7 @@ package scala.collection.mutable
* @param initSize: initial size in bits
*/
-[serializable]
+@serializable
class BitSet(initSize: Int) extends collection.BitSet with Set[Int] {
import compat.Platform.arraycopy
diff --git a/src/library/scala/collection/mutable/Buffer.scala b/src/library/scala/collection/mutable/Buffer.scala
index 5d8f24393c..fa9c5a02ba 100644
--- a/src/library/scala/collection/mutable/Buffer.scala
+++ b/src/library/scala/collection/mutable/Buffer.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -22,7 +22,7 @@ import Predef._
* @author Matthias Zenger
* @version 1.1, 02/03/2004
*/
-[cloneable]
+@cloneable
trait Buffer[A] extends AnyRef
with Seq[A]
with Scriptable[Message[Pair[Location, A]]]
@@ -237,7 +237,8 @@ trait Buffer[A] extends AnyRef
*
* @return never.
*/
- override def hashCode(): Int = throw new UnsupportedOperationException("unsuitable as hash key")
+ override def hashCode(): Int =
+ throw new UnsupportedOperationException("unsuitable as hash key")
/** Defines the prefix of the string representation.
*/
diff --git a/src/library/scala/collection/mutable/DefaultEntry.scala b/src/library/scala/collection/mutable/DefaultEntry.scala
index 876319a15d..3223911d20 100755
--- a/src/library/scala/collection/mutable/DefaultEntry.scala
+++ b/src/library/scala/collection/mutable/DefaultEntry.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -13,6 +13,6 @@ package scala.collection.mutable
import Predef._
-[serializable]
+@serializable
final class DefaultEntry[A, B](val key: A, var value: B)
extends HashEntry[A, DefaultEntry[A, B]]
diff --git a/src/library/scala/collection/mutable/HashMap.scala b/src/library/scala/collection/mutable/HashMap.scala
index 863a535aef..799451a6ca 100644
--- a/src/library/scala/collection/mutable/HashMap.scala
+++ b/src/library/scala/collection/mutable/HashMap.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -29,7 +29,7 @@ object HashMap {
def apply[A, B](elems: Pair[A, B]*) = empty[A, B] ++ elems
}
-[serializable]
+@serializable
class HashMap[A, B] extends Map[A,B] with HashTable[A] with DefaultMapModel[A,B] {
def -= (key: A) { removeEntry(key) }
diff --git a/src/library/scala/collection/mutable/HashSet.scala b/src/library/scala/collection/mutable/HashSet.scala
index c1c6096fa9..6c5bf0a48b 100644
--- a/src/library/scala/collection/mutable/HashSet.scala
+++ b/src/library/scala/collection/mutable/HashSet.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -27,7 +27,7 @@ object HashSet {
def apply[A](elems: A*) = empty[A] ++ elems
}
-[serializable]
+@serializable
class HashSet[A] extends Set[A] with FlatHashTable[A] {
def contains(elem: A): Boolean = containsEntry(elem)
diff --git a/src/library/scala/collection/mutable/History.scala b/src/library/scala/collection/mutable/History.scala
index 4143e6e9de..f1bb2230b1 100644
--- a/src/library/scala/collection/mutable/History.scala
+++ b/src/library/scala/collection/mutable/History.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -20,7 +20,7 @@ package scala.collection.mutable
* @author Matthias Zenger
* @version 1.0, 08/07/2003
*/
-[serializable]
+@serializable
class History[A, B] extends AnyRef with Subscriber[A, B] with Iterable[Pair[B, A]] {
protected val log: Queue[Pair[B, A]] = new Queue[Pair[B, A]]
diff --git a/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala b/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala
index 37bbb9dce4..1bc55695d2 100644
--- a/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala
+++ b/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -22,7 +22,7 @@ package scala.collection.mutable
* @author Martin Odersky
* @version 2.0, 01/01/2007
*/
-[serializable]
+@serializable
class ImmutableMapAdaptor[A, B](protected var imap: immutable.Map[A, B])
extends Map[A, B]
{
diff --git a/src/library/scala/collection/mutable/ImmutableSetAdaptor.scala b/src/library/scala/collection/mutable/ImmutableSetAdaptor.scala
index 5c0b766303..76159a9e6f 100644
--- a/src/library/scala/collection/mutable/ImmutableSetAdaptor.scala
+++ b/src/library/scala/collection/mutable/ImmutableSetAdaptor.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -21,7 +21,7 @@ package scala.collection.mutable
* @author Matthias Zenger
* @version 1.0, 21/07/2003
*/
-[serializable]
+@serializable
class ImmutableSetAdaptor[A](protected var set: immutable.Set[A]) extends Set[A] {
def size: Int = set.size
diff --git a/src/library/scala/collection/mutable/LinkedList.scala b/src/library/scala/collection/mutable/LinkedList.scala
index 80bebc4775..bd5ae23532 100644
--- a/src/library/scala/collection/mutable/LinkedList.scala
+++ b/src/library/scala/collection/mutable/LinkedList.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -17,7 +17,7 @@ package scala.collection.mutable
* @author Matthias Zenger
* @version 1.0, 08/07/2003
*/
-[serializable]
+@serializable
class LinkedList[A](var elem: A, var next: LinkedList[A])
extends SingleLinkedList[A, LinkedList[A]]
{
diff --git a/src/library/scala/collection/mutable/Map.scala b/src/library/scala/collection/mutable/Map.scala
index 85b178fa82..92742d7d7b 100644
--- a/src/library/scala/collection/mutable/Map.scala
+++ b/src/library/scala/collection/mutable/Map.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -35,7 +35,7 @@ object Map {
def apply[A, B](elems: Pair[A, B]*) = empty[A, B] ++ elems
}
-[cloneable]
+@cloneable
trait Map[A, B] extends AnyRef
with collection.Map[A, B]
with Scriptable[Message[Pair[A, B]]]
@@ -60,7 +60,9 @@ trait Map[A, B] extends AnyRef
* @param kv2 the second key/value pair.
* @param kvs the remaining key/value pairs.
*/
- def += (kv1: Pair[A, B], kv2: Pair[A, B], kvs: Pair[A, B]*) { this += kv1; this += kv2; this ++= kvs }
+ def += (kv1: Pair[A, B], kv2: Pair[A, B], kvs: Pair[A, B]*) {
+ this += kv1; this += kv2; this ++= kvs
+ }
/** Add a sequence of key/value pairs to this map.
* @param kvs the iterable object containing all key/value pairs.
@@ -200,7 +202,8 @@ trait Map[A, B] extends AnyRef
* </pre>
* @deprecated use <code>+={key, value}</code>
*/
- [deprecated] def +=(key: A): MapTo = new MapTo(key)
+ @deprecated
+ def +=(key: A): MapTo = new MapTo(key)
/** <code>incl</code> can be used to add many mappings at the same time
* to the map. The method assumes that a mapping is represented
@@ -210,7 +213,8 @@ trait Map[A, B] extends AnyRef
* @param mappings
* @deprecated use <code>+=</code>
*/
- [deprecated] def incl(mappings: Pair[A, B]*): Unit = this ++= mappings.elements
+ @deprecated
+ def incl(mappings: Pair[A, B]*): Unit = this ++= mappings.elements
/** This method will remove all the mappings for the given sequence
* of keys from the map.
@@ -218,22 +222,25 @@ trait Map[A, B] extends AnyRef
* @param keys
* @deprecated use <code>-=</code>
*/
- [deprecated] def excl(keys: A*): Unit = this --= keys.elements
+ @deprecated
+ def excl(keys: A*): Unit = this --= keys.elements
/** This method removes all the mappings for which the predicate
* <code>p</code> returns <code>false</code>.
*
- * @deprecated use retain instead
+ * @deprecated use <code>retain</code> instead
* @param p
*/
- [deprecated] override def filter(p: Pair[A, B] => Boolean): Iterable[Pair[A, B]] = {
+ @deprecated
+ override def filter(p: Pair[A, B] => Boolean): Iterable[Pair[A, B]] = {
toList foreach {
case kv @ Pair(key, _) => if (!p(kv)) -=(key)
}
this
}
- [deprecated] class MapTo(key: A) {
+ @deprecated
+ class MapTo(key: A) {
def ->(value: B): Unit = update(key, value)
}
diff --git a/src/library/scala/collection/mutable/MapProxy.scala b/src/library/scala/collection/mutable/MapProxy.scala
index 431a9d5273..a1c11e7de1 100644
--- a/src/library/scala/collection/mutable/MapProxy.scala
+++ b/src/library/scala/collection/mutable/MapProxy.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -21,8 +21,7 @@ package scala.collection.mutable
* dynamically using object composition and forwarding.
* </p>
*
- * @author Matthias Zenger
- * @author Martin Odersky
+ * @author Matthias Zenger, Martin Odersky
* @version 2.0, 31/12/2006
*/
trait MapProxy[A, B] extends Map[A, B] with collection.MapProxy[A, B] {
@@ -51,6 +50,8 @@ trait MapProxy[A, B] extends Map[A, B] with collection.MapProxy[A, B] {
override def retain(p: (A, B) => Boolean): Unit = self retain p
override def <<(cmd: Message[Pair[A, B]]): Unit = self << cmd
override def clone(): Map[A, B] = self.clone()
- [deprecated] override def incl(mappings: Pair[A, B]*): Unit = self.incl(mappings: _*)
- [deprecated] override def excl(keys: A*): Unit = self.excl(keys: _*)
+ @deprecated
+ override def incl(mappings: Pair[A, B]*): Unit = self.incl(mappings: _*)
+ @deprecated
+ override def excl(keys: A*): Unit = self.excl(keys: _*)
}
diff --git a/src/library/scala/collection/mutable/PriorityQueue.scala b/src/library/scala/collection/mutable/PriorityQueue.scala
index 4f67392381..84814862f7 100644
--- a/src/library/scala/collection/mutable/PriorityQueue.scala
+++ b/src/library/scala/collection/mutable/PriorityQueue.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -22,7 +22,7 @@ package scala.collection.mutable
* @version 1.0, 03/05/2004
*/
-[serializable, cloneable]
+@serializable @cloneable
class PriorityQueue[A <% Ordered[A]] extends ResizableArray[A] {
size = size + 1 // we do not use array(0)
@@ -165,7 +165,8 @@ class PriorityQueue[A <% Ordered[A]] extends ResizableArray[A] {
*
* @return never.
*/
- override def hashCode(): Int = throw new UnsupportedOperationException("unsuitable as hash key")
+ override def hashCode(): Int =
+ throw new UnsupportedOperationException("unsuitable as hash key")
/** Returns a regular queue containing the same elements.
*/
diff --git a/src/library/scala/collection/mutable/Queue.scala b/src/library/scala/collection/mutable/Queue.scala
index ae4797e207..2814085b4b 100644
--- a/src/library/scala/collection/mutable/Queue.scala
+++ b/src/library/scala/collection/mutable/Queue.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -20,7 +20,7 @@ package scala.collection.mutable
* @author Matthias Zenger
* @version 1.1, 03/05/2004
*/
-[serializable, cloneable]
+@serializable @cloneable
class Queue[A] extends MutableList[A] {
/** Checks if the queue is empty.
diff --git a/src/library/scala/collection/mutable/RevertableHistory.scala b/src/library/scala/collection/mutable/RevertableHistory.scala
index 9ad19dedc7..6a9607083c 100644
--- a/src/library/scala/collection/mutable/RevertableHistory.scala
+++ b/src/library/scala/collection/mutable/RevertableHistory.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -20,7 +20,7 @@ package scala.collection.mutable
* @author Matthias Zenger
* @version 1.0, 08/07/2003
*/
-[serializable]
+@serializable
class RevertableHistory[A <: Undoable, B] extends History[A, B] with Undoable {
/** Rollback the full history.
diff --git a/src/library/scala/collection/mutable/Set.scala b/src/library/scala/collection/mutable/Set.scala
index 16b1b8440b..0aef3243b5 100644
--- a/src/library/scala/collection/mutable/Set.scala
+++ b/src/library/scala/collection/mutable/Set.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -31,7 +31,7 @@ object Set {
def apply[A](elems: A*) = empty[A] ++ elems
}
-[cloneable]
+@cloneable
trait Set[A] extends collection.Set[A] with Scriptable[Message[A]] {
/** This method allows one to add or remove an element <code>elem</code>
@@ -101,7 +101,8 @@ trait Set[A] extends collection.Set[A] with Scriptable[Message[A]] {
* at the same time.
* @deprecated use <code>++=</code> instead
*/
- [deprecated] def incl(elems: A*): Unit = ++=(elems.elements)
+ @deprecated
+ def incl(elems: A*): Unit = ++=(elems.elements)
/** Removes a single element from a set.
* @param elem The element to be removed.
@@ -157,7 +158,8 @@ trait Set[A] extends collection.Set[A] with Scriptable[Message[A]] {
/** <code>excl</code> removes many elements from the set.
*/
- [deprecated] def excl(elems: A*): Unit = --=(elems.elements)
+ @deprecated
+ def excl(elems: A*): Unit = --=(elems.elements)
/** This method computes an intersection with set <code>that</code>.
* It removes all the elements that are not present in <code>that</code>.
@@ -170,7 +172,8 @@ trait Set[A] extends collection.Set[A] with Scriptable[Message[A]] {
* which the predicate <code>p</code> yields the value <code>false</code>.
* @deprecated use retain instead
*/
- [deprecated] override def filter(p: A => Boolean): Set[A] = {
+ @deprecated
+ override def filter(p: A => Boolean): Set[A] = {
toList.foreach {
elem => if (!p(elem)) -=(elem)
}
diff --git a/src/library/scala/collection/mutable/SetProxy.scala b/src/library/scala/collection/mutable/SetProxy.scala
index 0cba74da40..69c07a10b1 100644
--- a/src/library/scala/collection/mutable/SetProxy.scala
+++ b/src/library/scala/collection/mutable/SetProxy.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -48,7 +48,8 @@ trait SetProxy[A] extends Set[A] with collection.SetProxy[A] {
override def retain(p: A => Boolean): Unit = self.retain(p)
- [deprecated] override def filter(p: A => Boolean) = self.filter(p)
+ @deprecated
+ override def filter(p: A => Boolean) = self.filter(p)
override def <<(cmd: Message[A]): Unit = self << cmd
diff --git a/src/library/scala/collection/mutable/Stack.scala b/src/library/scala/collection/mutable/Stack.scala
index e3890d22df..a8623d69f1 100644
--- a/src/library/scala/collection/mutable/Stack.scala
+++ b/src/library/scala/collection/mutable/Stack.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -18,7 +18,7 @@ package scala.collection.mutable
* @author Matthias Zenger
* @version 1.1, 03/05/2004
*/
-[serializable, cloneable]
+@serializable @cloneable
class Stack[A] extends MutableList[A] {
/** Checks if the stack is empty.
@@ -63,7 +63,9 @@ class Stack[A] extends MutableList[A] {
* @throws Predef.NoSuchElementException
* @return the top element
*/
- def top: A = if (first eq null) throw new NoSuchElementException("stack empty") else first.elem
+ def top: A =
+ if (first eq null) throw new NoSuchElementException("stack empty")
+ else first.elem
/** Removes the top element from the stack.
*
@@ -117,7 +119,8 @@ class Stack[A] extends MutableList[A] {
*
* @return never.
*/
- override def hashCode(): Int = throw new UnsupportedOperationException("unsuitable as hash key")
+ override def hashCode(): Int =
+ throw new UnsupportedOperationException("unsuitable as hash key")
/** This method clones the stack.
*
diff --git a/src/library/scala/collection/mutable/SynchronizedMap.scala b/src/library/scala/collection/mutable/SynchronizedMap.scala
index 785e061a4e..800e6fc528 100644
--- a/src/library/scala/collection/mutable/SynchronizedMap.scala
+++ b/src/library/scala/collection/mutable/SynchronizedMap.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -15,8 +15,7 @@ package scala.collection.mutable
/** This class should be used as a mixin. It synchronizes the <code>Map</code>
* functions of the class into which it is mixed in.
*
- * @author Matthias Zenger
- * @author Martin Odersky
+ * @author Matthias Zenger, Martin Odersky
* @version 2.0, 31/12/2006
*/
trait SynchronizedMap[A, B] extends Map[A, B] {
@@ -90,7 +89,8 @@ trait SynchronizedMap[A, B] extends Map[A, B] {
super.++=(it)
}
- [deprecated] override def incl(mappings: Pair[A, B]*): Unit = synchronized {
+ @deprecated
+ override def incl(mappings: Pair[A, B]*): Unit = synchronized {
super.incl(mappings: _*)
}
@@ -110,7 +110,8 @@ trait SynchronizedMap[A, B] extends Map[A, B] {
super.--=(it)
}
- [deprecated] override def excl(keys: A*): Unit = synchronized {
+ @deprecated
+ override def excl(keys: A*): Unit = synchronized {
super.excl(keys: _*)
}
@@ -122,7 +123,8 @@ trait SynchronizedMap[A, B] extends Map[A, B] {
super.transform(f)
}
- [deprecated] override def map[C](f: Pair[A, B] => C) = synchronized {
+ @deprecated
+ override def map[C](f: Pair[A, B] => C) = synchronized {
super.map(f)
}
@@ -131,7 +133,8 @@ trait SynchronizedMap[A, B] extends Map[A, B] {
}
/** @deprecated use retain instead */
- [deprecated] override def filter(p: Pair[A, B] => Boolean) = synchronized {
+ @deprecated
+ override def filter(p: Pair[A, B] => Boolean) = synchronized {
super.filter(p)
}
diff --git a/src/library/scala/collection/mutable/SynchronizedSet.scala b/src/library/scala/collection/mutable/SynchronizedSet.scala
index 9c11519ba4..2dfa6b651d 100644
--- a/src/library/scala/collection/mutable/SynchronizedSet.scala
+++ b/src/library/scala/collection/mutable/SynchronizedSet.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -84,7 +84,8 @@ trait SynchronizedSet[A] extends Set[A] {
super.foreach(f)
}
- [deprecated] override def filter(p: A => Boolean) = synchronized {
+ @deprecated
+ override def filter(p: A => Boolean) = synchronized {
super.filter(p)
}
diff --git a/src/library/scala/runtime/BoxedAnyArray.scala b/src/library/scala/runtime/BoxedAnyArray.scala
index d979e34523..2c8711d763 100644
--- a/src/library/scala/runtime/BoxedAnyArray.scala
+++ b/src/library/scala/runtime/BoxedAnyArray.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -19,7 +19,7 @@ import compat.Platform
* Arrays created by <code>new Array[T](length)</code> where <code>T</code>
* is a type variable.
*/
-[serializable]
+@serializable
final class BoxedAnyArray(val length: Int) extends BoxedArray {
private var boxed = new Array[AnyRef](length)
diff --git a/src/library/scala/runtime/BoxedBooleanArray.scala b/src/library/scala/runtime/BoxedBooleanArray.scala
index 1c434db467..0ed995595c 100644
--- a/src/library/scala/runtime/BoxedBooleanArray.scala
+++ b/src/library/scala/runtime/BoxedBooleanArray.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -14,7 +14,7 @@ package scala.runtime
import Predef.Class
-[serializable]
+@serializable
final class BoxedBooleanArray(val value: Array[Boolean]) extends BoxedArray {
def length: Int = value.length
diff --git a/src/library/scala/runtime/BoxedByteArray.scala b/src/library/scala/runtime/BoxedByteArray.scala
index 8580acf2a4..b63f5e5bf7 100644
--- a/src/library/scala/runtime/BoxedByteArray.scala
+++ b/src/library/scala/runtime/BoxedByteArray.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -14,7 +14,7 @@ package scala.runtime
import Predef.Class
-[serializable]
+@serializable
final class BoxedByteArray(val value: Array[Byte]) extends BoxedArray {
def length: Int = value.length
diff --git a/src/library/scala/runtime/BoxedCharArray.scala b/src/library/scala/runtime/BoxedCharArray.scala
index 7e93c71c30..9d8a24159d 100644
--- a/src/library/scala/runtime/BoxedCharArray.scala
+++ b/src/library/scala/runtime/BoxedCharArray.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -9,24 +9,24 @@
// $Id$
-package scala.runtime;
+package scala.runtime
import Predef.Class
-[serializable]
+@serializable
final class BoxedCharArray(val value: Array[Char]) extends BoxedArray {
- def length: Int = value.length;
+ def length: Int = value.length
- def apply(index: Int): Any = Char.box(value(index));
+ def apply(index: Int): Any = Char.box(value(index))
def update(index: Int, elem: Any): Unit = {
value(index) = Char.unbox(elem.asInstanceOf[AnyRef])
}
- def unbox(elemTag: String): AnyRef = value;
- def unbox(elemClass: Class): AnyRef = value;
+ def unbox(elemTag: String): AnyRef = value
+ def unbox(elemClass: Class): AnyRef = value
override def equals(other: Any) = (
value == other ||
@@ -36,22 +36,22 @@ final class BoxedCharArray(val value: Array[Char]) extends BoxedArray {
override def hashCode(): Int = value.hashCode();
def subArray(start: Int, end: Int): Array[Char] = {
- val result = new Array[Char](end - start);
+ val result = new Array[Char](end - start)
Array.copy(value, start, result, 0, end - start)
result
}
final override def filter(p: Any => Boolean): BoxedArray = {
- val include = new Array[Boolean](value.length);
- var len = 0;
- var i = 0;
+ val include = new Array[Boolean](value.length)
+ var len = 0
+ var i = 0
while (i < value.length) {
if (p(value(i))) { include(i) = true; len = len + 1 }
i = i + 1
}
- val result = new Array[Char](len);
- len = 0;
- i = 0;
+ val result = new Array[Char](len)
+ len = 0
+ i = 0
while (len < result.length) {
if (include(i)) { result(len) = value(i); len = len + 1 }
i = i + 1
diff --git a/src/library/scala/runtime/BoxedDoubleArray.scala b/src/library/scala/runtime/BoxedDoubleArray.scala
index 951828e1cd..f0a1de24c5 100644
--- a/src/library/scala/runtime/BoxedDoubleArray.scala
+++ b/src/library/scala/runtime/BoxedDoubleArray.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -14,7 +14,7 @@ package scala.runtime
import Predef.Class
-[serializable]
+@serializable
final class BoxedDoubleArray(val value: Array[Double]) extends BoxedArray {
def length: Int = value.length
diff --git a/src/library/scala/runtime/BoxedFloatArray.scala b/src/library/scala/runtime/BoxedFloatArray.scala
index 9e22386370..8241704265 100644
--- a/src/library/scala/runtime/BoxedFloatArray.scala
+++ b/src/library/scala/runtime/BoxedFloatArray.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -14,7 +14,7 @@ package scala.runtime
import Predef.Class
-[serializable]
+@serializable
final class BoxedFloatArray(val value: Array[Float]) extends BoxedArray {
def length: Int = value.length
diff --git a/src/library/scala/runtime/BoxedIntArray.scala b/src/library/scala/runtime/BoxedIntArray.scala
index 633504a98f..8bc4f37207 100644
--- a/src/library/scala/runtime/BoxedIntArray.scala
+++ b/src/library/scala/runtime/BoxedIntArray.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -14,7 +14,7 @@ package scala.runtime
import Predef.Class
-[serializable]
+@serializable
final class BoxedIntArray(val value: Array[Int]) extends BoxedArray {
def length: Int = value.length
diff --git a/src/library/scala/runtime/BoxedLongArray.scala b/src/library/scala/runtime/BoxedLongArray.scala
index 9d0b7175d5..c75bb5390a 100644
--- a/src/library/scala/runtime/BoxedLongArray.scala
+++ b/src/library/scala/runtime/BoxedLongArray.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -14,7 +14,7 @@ package scala.runtime
import Predef.Class
-[serializable]
+@serializable
final class BoxedLongArray(val value: Array[Long]) extends BoxedArray {
def length: Int = value.length
diff --git a/src/library/scala/runtime/BoxedObjectArray.scala b/src/library/scala/runtime/BoxedObjectArray.scala
index 48b1da7e8a..5c23e8257b 100644
--- a/src/library/scala/runtime/BoxedObjectArray.scala
+++ b/src/library/scala/runtime/BoxedObjectArray.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -15,7 +15,7 @@ package scala.runtime
import Predef._
import compat.Platform.createArray
-[serializable]
+@serializable
final class BoxedObjectArray(val value: Array[AnyRef]) extends BoxedArray {
def length: Int = value.length
diff --git a/src/library/scala/runtime/BoxedShortArray.scala b/src/library/scala/runtime/BoxedShortArray.scala
index 256bd43727..4a3e9a06c0 100644
--- a/src/library/scala/runtime/BoxedShortArray.scala
+++ b/src/library/scala/runtime/BoxedShortArray.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -14,7 +14,7 @@ package scala.runtime;
import Predef.Class
-[serializable]
+@serializable
final class BoxedShortArray(val value: Array[Short]) extends BoxedArray {
def length: Int = value.length
diff --git a/src/library/scala/runtime/StringAdd.scala b/src/library/scala/runtime/StringAdd.scala
index a1a6a88d11..0f1ef43dbb 100644
--- a/src/library/scala/runtime/StringAdd.scala
+++ b/src/library/scala/runtime/StringAdd.scala
@@ -1,12 +1,13 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
// $Id$
+
package scala.runtime
final class StringAdd(self: Any) {
diff --git a/src/library/scala/xml/Atom.scala b/src/library/scala/xml/Atom.scala
index deea2c00e8..b206702bc7 100644
--- a/src/library/scala/xml/Atom.scala
+++ b/src/library/scala/xml/Atom.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -19,7 +19,7 @@ import compat.StringBuilder
* @author Burak Emir
* @param text the text contained in this node, may not be <code>null</code>.
*/
-[serializable]
+@serializable
class Atom[+A](val data: A) extends SpecialNode {
data.asInstanceOf[AnyRef] match {
diff --git a/src/library/scala/xml/Group.scala b/src/library/scala/xml/Group.scala
index e7c8313db5..a124276c87 100644
--- a/src/library/scala/xml/Group.scala
+++ b/src/library/scala/xml/Group.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -19,7 +19,7 @@ import compat.StringBuilder
* @author Burak Emir
* @version 1.0
*/
-[serializable]
+@serializable
case class Group(val nodes: Seq[Node]) extends Node {
override def theSeq = nodes
diff --git a/src/library/scala/xml/MetaData.scala b/src/library/scala/xml/MetaData.scala
index 0eb572a801..b75e9a9e8b 100644
--- a/src/library/scala/xml/MetaData.scala
+++ b/src/library/scala/xml/MetaData.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -25,7 +25,7 @@ import compat.StringBuilder
*
* @todo _vlue should be a normalized attribute value
*/
-[serializable]
+@serializable
abstract class MetaData extends Iterable[MetaData] {
/** appends given MetaData items to this MetaData list.
@@ -149,6 +149,7 @@ abstract class MetaData extends Iterable[MetaData] {
/** gets value of qualified (prefixed) attribute with given key.
+ *
* @param uri namespace of key
* @param scope a namespace scp (usually of the element owning this attribute list)
* @param key to be looked fore
diff --git a/src/library/scala/xml/NamespaceBinding.scala b/src/library/scala/xml/NamespaceBinding.scala
index c1acb444e5..4fb751ddfe 100644
--- a/src/library/scala/xml/NamespaceBinding.scala
+++ b/src/library/scala/xml/NamespaceBinding.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -23,7 +23,7 @@ import compat.StringBuilder
* @author Burak Emir
* @version 1.0
*/
-[serializable]
+@serializable
class NamespaceBinding(val prefix: String,
val uri: String,
val parent: NamespaceBinding) extends AnyRef {
diff --git a/src/library/scala/xml/dtd/ContentModel.scala b/src/library/scala/xml/dtd/ContentModel.scala
index 0f7eb6e8cb..db82bea3a2 100644
--- a/src/library/scala/xml/dtd/ContentModel.scala
+++ b/src/library/scala/xml/dtd/ContentModel.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -9,15 +9,15 @@
// $Id$
-package scala.xml.dtd;
+package scala.xml.dtd
-import compat.StringBuilder;
-import scala.util.regexp.WordExp;
-import scala.util.automata._;
+import compat.StringBuilder
+import scala.util.regexp.WordExp
+import scala.util.automata._
object ContentModel extends WordExp {
- type _labelT = ElemName;
- type _regexpT = RegExp;
+ type _labelT = ElemName
+ type _regexpT = RegExp
object Translator extends WordBerrySethi {
@@ -29,16 +29,16 @@ object ContentModel extends WordExp {
case class ElemName(name: String) extends Label {
- override def toString() = "ElemName(\""+name+"\")";
+ override def toString() = "ElemName(\""+name+"\")"
}
def isMixed(cm: ContentModel) = cm.isInstanceOf[MIXED];
- def containsText(cm: ContentModel) = (cm == PCDATA) || isMixed(cm);
+ def containsText(cm: ContentModel) = (cm == PCDATA) || isMixed(cm)
- def parse(s: String): ContentModel = ContentModelParser.parse( s );
+ def parse(s: String): ContentModel = ContentModelParser.parse(s)
def getLabels(r: RegExp): scala.collection.Set[String] = {
- val s = new scala.collection.mutable.HashSet[String]();
+ val s = new scala.collection.mutable.HashSet[String]()
def traverse1(xs: Seq[RegExp]): Unit = {
val it = xs.elements;
while( it.hasNext )
@@ -47,77 +47,66 @@ object ContentModel extends WordExp {
def traverse(r: RegExp): Unit = {
r match {
case Letter(ElemName( name )) => s += name;
- case Star( x @ _ ) => traverse( x ); // bug if x@_*
- case Sequ( xs @ _* ) => traverse1(xs);
- case Alt( xs @ _* ) => traverse1(xs);
+ case Star( x @ _ ) => traverse( x ) // bug if x@_*
+ case Sequ( xs @ _* ) => traverse1(xs)
+ case Alt( xs @ _* ) => traverse1(xs)
}
}
- traverse( r );
+ traverse(r)
return s
}
- def toString(r: RegExp):String = {
- val sb = new StringBuilder();
- toString(r, sb);
- sb.toString();
+ def toString(r: RegExp): String = {
+ val sb = new StringBuilder()
+ toString(r, sb)
+ sb.toString()
}
/* precond: rs.length >= 1 */
private def toString(rs: Seq[RegExp], sb: StringBuilder, sep: Char): Unit = {
- val it = rs.elements;
- val fst = it.next;
- toString(fst, sb);
+ val it = rs.elements
+ val fst = it.next
+ toString(fst, sb)
for(val z <- it) {
- sb.append( sep );
- toString( z, sb );
+ sb.append(sep)
+ toString(z, sb)
}
sb
}
def toString(c: ContentModel, sb: StringBuilder): StringBuilder = c match {
-
- case ANY =>
- sb.append("ANY");
-
- case EMPTY =>
- sb.append("EMPTY");
-
- case PCDATA =>
- sb.append("(#PCDATA)");
-
- case ELEMENTS( _ ) | MIXED( _ ) =>
- c.toString(sb)
-
+ case ANY =>
+ sb.append("ANY")
+ case EMPTY =>
+ sb.append("EMPTY")
+ case PCDATA =>
+ sb.append("(#PCDATA)")
+ case ELEMENTS( _ ) | MIXED( _ ) =>
+ c.toString(sb)
}
- def toString(r: RegExp, sb:StringBuilder): StringBuilder = {
- r match {
- case Eps =>
- sb
-
- case Sequ(rs @ _*) =>
- sb.append( '(' ); toString(rs, sb, ','); sb.append( ')' );
-
- case Alt(rs @ _*) =>
- sb.append( '(' ); toString(rs, sb, '|'); sb.append( ')' );
-
- case Star(r: RegExp) =>
- sb.append( '(' ); toString(r, sb); sb.append( ")*" );
-
- case Letter(ElemName(name)) =>
- sb.append(name);
-
- }
+ def toString(r: RegExp, sb:StringBuilder): StringBuilder = r match {
+ case Eps =>
+ sb
+ case Sequ(rs @ _*) =>
+ sb.append( '(' ); toString(rs, sb, ','); sb.append( ')' )
+ case Alt(rs @ _*) =>
+ sb.append( '(' ); toString(rs, sb, '|'); sb.append( ')' )
+ case Star(r: RegExp) =>
+ sb.append( '(' ); toString(r, sb); sb.append( ")*" )
+ case Letter(ElemName(name)) =>
+ sb.append(name)
}
}
sealed abstract class ContentModel {
+
override def toString(): String = {
- val sb = new StringBuilder();
- toString(sb);
- sb.toString();
+ val sb = new StringBuilder()
+ toString(sb)
+ sb.toString()
}
def toString(sb:StringBuilder): StringBuilder;
@@ -134,18 +123,18 @@ sealed abstract class ContentModel {
}
case object PCDATA extends ContentModel {
- override def toString(sb:StringBuilder): StringBuilder = sb.append("(#PCDATA)");
+ override def toString(sb:StringBuilder): StringBuilder = sb.append("(#PCDATA)")
}
case object EMPTY extends ContentModel {
- override def toString(sb:StringBuilder): StringBuilder = sb.append("EMPTY");
+ override def toString(sb:StringBuilder): StringBuilder = sb.append("EMPTY")
}
case object ANY extends ContentModel {
- override def toString(sb:StringBuilder): StringBuilder = sb.append("ANY");
+ override def toString(sb:StringBuilder): StringBuilder = sb.append("ANY")
}
abstract class DFAContentModel extends ContentModel {
- import ContentModel.{ ElemName };
- def r: ContentModel.RegExp;
- private var _dfa: DetWordAutom[ContentModel.ElemName] = null;
+ import ContentModel.ElemName
+ def r: ContentModel.RegExp
+ private var _dfa: DetWordAutom[ContentModel.ElemName] = null
def dfa = {
if(null == _dfa) {
@@ -207,6 +196,6 @@ case class ELEMENTS(r:ContentModel.RegExp) extends DFAContentModel {
}
}
*/
- override def toString(sb:StringBuilder): StringBuilder =
- ContentModel.toString(r, sb);
+ override def toString(sb: StringBuilder): StringBuilder =
+ ContentModel.toString(r, sb)
}
diff --git a/src/library/scala/xml/parsing/ValidatingMarkupHandler.scala b/src/library/scala/xml/parsing/ValidatingMarkupHandler.scala
index a233cc527c..33413db62c 100644
--- a/src/library/scala/xml/parsing/ValidatingMarkupHandler.scala
+++ b/src/library/scala/xml/parsing/ValidatingMarkupHandler.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -9,24 +9,24 @@
// $Id$
-package scala.xml.parsing;
+package scala.xml.parsing
-import scala.xml.dtd._ ;
-import scala.util.logging.Logged ;
+import scala.xml.dtd._
+import scala.util.logging.Logged
abstract class ValidatingMarkupHandler extends MarkupHandler with Logged {
- var rootLabel:String = _;
- var qStack: List[Int] = Nil;
- var qCurrent: Int = -1;
+ var rootLabel:String = _
+ var qStack: List[Int] = Nil
+ var qCurrent: Int = -1
- var declStack: List[ElemDecl] = Nil;
- var declCurrent: ElemDecl = null;
+ var declStack: List[ElemDecl] = Nil
+ var declCurrent: ElemDecl = null
- final override val isValidating = true;
+ final override val isValidating = true
- override def log(msg:String) = {};
+ override def log(msg:String) = {}
/*
override def checkChildren(pos: Int, pre: String, label:String,ns:NodeSeq): Unit = {
@@ -41,14 +41,14 @@ abstract class ValidatingMarkupHandler extends MarkupHandler with Logged {
*/
override def endDTD(n:String) = {
- rootLabel = n;
+ rootLabel = n
}
override def elemStart(pos: int, pre: String, label: String, attrs: MetaData, scope:NamespaceBinding): Unit = {
def advanceDFA(dm:DFAContentModel) = {
- val trans = dm.dfa.delta(qCurrent);
- log("advanceDFA(dm): "+dm);
- log("advanceDFA(trans): "+trans);
+ val trans = dm.dfa.delta(qCurrent)
+ log("advanceDFA(dm): " + dm)
+ log("advanceDFA(trans): " + trans)
trans.get(ContentModel.ElemName(label)) match {
case Some(qNew) => qCurrent = qNew
case _ => reportValidationError(pos, "DTD says, wrong element, expected one of "+trans.keys.toString());
@@ -57,41 +57,41 @@ abstract class ValidatingMarkupHandler extends MarkupHandler with Logged {
// advance in current automaton
log("[qCurrent = "+qCurrent+" visiting "+label+"]");
- if(qCurrent == -1) { // root
- log(" checking root");
- if(label != rootLabel)
+ if (qCurrent == -1) { // root
+ log(" checking root")
+ if (label != rootLabel)
reportValidationError(pos, "this element should be "+rootLabel);
} else {
log(" checking node");
declCurrent.contentModel match {
- case ANY =>
-
- case EMPTY =>
- reportValidationError(pos, "DTD says, no elems, no text allowed here");
- case PCDATA =>
+ case ANY =>
+ case EMPTY =>
+ reportValidationError(pos, "DTD says, no elems, no text allowed here");
+ case PCDATA =>
reportValidationError(pos, "DTD says, no elements allowed here");
-
- case m@MIXED(r) => advanceDFA(m);
- case e@ELEMENTS(r) => advanceDFA(e);
+ case m @ MIXED(r) =>
+ advanceDFA(m)
+ case e @ ELEMENTS(r) =>
+ advanceDFA(e)
}
}
// push state, decl
- qStack = qCurrent :: qStack;
- declStack = declCurrent :: declStack;
+ qStack = qCurrent :: qStack
+ declStack = declCurrent :: declStack
- declCurrent = lookupElemDecl(label);
- qCurrent = 0;
- log(" done now");
+ declCurrent = lookupElemDecl(label)
+ qCurrent = 0
+ log(" done now")
}
override def elemEnd(pos: int, pre: String, label: String): Unit = {
- log(" elemEnd");
- qCurrent = qStack.head;
- qStack = qStack.tail;
- declCurrent = declStack.head;
- declStack = declStack.tail;
- log(" qCurrent now"+qCurrent);
- log(" declCurrent now"+declCurrent);
+ log(" elemEnd")
+ qCurrent = qStack.head
+ qStack = qStack.tail
+ declCurrent = declStack.head
+ declStack = declStack.tail
+ log(" qCurrent now" + qCurrent)
+ log(" declCurrent now" + declCurrent)
}
final override def elemDecl(name: String, cmstr: String): Unit =