Use attributes instead of java.lang.Cloneable, java.io.Serializable
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@5590 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
parent
9a5a5e3bbc
commit
441cb9e3ce
|
@ -1,6 +1,6 @@
|
|||
/* __ *\
|
||||
** ________ ___ / / ___ Scala API **
|
||||
** / __/ __// _ | / / / _ | (c) 2002, LAMP/EPFL **
|
||||
** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
|
||||
** __\ \/ /__/ __ |/ /__/ __ | **
|
||||
** /____/\___/_/ |_/____/_/ | | **
|
||||
** |/ **
|
||||
|
@ -26,7 +26,8 @@ object Array {
|
|||
}
|
||||
}
|
||||
|
||||
final class Array[A](_length: Int) extends Cloneable with java.io.Serializable with Seq[A] {
|
||||
[cloneable,serializable]
|
||||
final class Array[A](_length: Int) extends Seq[A] {
|
||||
def length: Int = throw new Error();
|
||||
def apply(i: Int): A = throw new Error();
|
||||
def update(i: Int, x: A): Unit = throw new Error();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* __ *\
|
||||
** ________ ___ / / ___ Scala API **
|
||||
** / __/ __// _ | / / / _ | (c) 2003-2004, LAMP/EPFL **
|
||||
** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
|
||||
** __\ \/ /__/ __ |/ /__/ __ | **
|
||||
** /____/\___/_/ |_/____/_/ | | **
|
||||
** |/ **
|
||||
|
@ -59,8 +59,9 @@ package scala.collection.immutable;
|
|||
* @author Michel Schinz
|
||||
* @version 1.1, 2005-01-20
|
||||
*/
|
||||
//[serializable]
|
||||
abstract class Tree[A <% Ordered[A], B]() extends AnyRef with java.io.Serializable {
|
||||
|
||||
[serializable]
|
||||
abstract class Tree[A <% Ordered[A], B]() extends AnyRef {
|
||||
/* Data structure:
|
||||
** - size:Int - the number of elements in the tree.
|
||||
** - tree:T, which is composed of nodes of the form:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* __ *\
|
||||
** ________ ___ / / ___ Scala API **
|
||||
** / __/ __// _ | / / / _ | (c) 2003-2005, LAMP/EPFL **
|
||||
** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
|
||||
** __\ \/ /__/ __ |/ /__/ __ | **
|
||||
** /____/\___/_/ |_/____/_/ | | **
|
||||
** |/ **
|
||||
|
@ -19,8 +19,9 @@ object TreeMap {
|
|||
* @author Matthias Zenger
|
||||
* @version 1.1, 03/05/2004
|
||||
*/
|
||||
//[serializable]
|
||||
class TreeMap[A <% Ordered[A], B] extends Tree[A, Pair[A, B]] with Map[A, B] with java.io.Serializable {
|
||||
|
||||
[serializable]
|
||||
class TreeMap[A <% Ordered[A], B] extends Tree[A, Pair[A, B]] with Map[A, B] {
|
||||
|
||||
override protected type This = TreeMap[A, B];
|
||||
override protected def getThis: This = this;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* __ *\
|
||||
** ________ ___ / / ___ Scala API **
|
||||
** / __/ __// _ | / / / _ | (c) 2003-2005, LAMP/EPFL **
|
||||
** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
|
||||
** __\ \/ /__/ __ |/ /__/ __ | **
|
||||
** /____/\___/_/ |_/____/_/ | | **
|
||||
** |/ **
|
||||
|
@ -17,8 +17,9 @@ package scala.collection.immutable;
|
|||
* @author Burak Emir
|
||||
* @version 1.1, 03/05/2004
|
||||
*/
|
||||
//[serializable]
|
||||
class TreeSet[A <% Ordered[A]]() extends Tree[A, A] with Set[A] with java.io.Serializable {
|
||||
|
||||
[serializable]
|
||||
class TreeSet[A <% Ordered[A]]() extends Tree[A, A] with Set[A] {
|
||||
|
||||
override protected type This = TreeSet[A];
|
||||
override protected def getThis: This = this;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* __ *\
|
||||
** ________ ___ / / ___ Scala API **
|
||||
** / __/ __// _ | / / / _ | (c) 2003, LAMP/EPFL **
|
||||
** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
|
||||
** __\ \/ /__/ __ |/ /__/ __ | **
|
||||
** /____/\___/_/ |_/____/_/ | | **
|
||||
** |/ **
|
||||
|
@ -13,14 +13,15 @@ package scala.collection.mutable;
|
|||
/** This class implements priority queues using a heap. The
|
||||
* elements of the queue have to be ordered in terms of the
|
||||
* <code>Ordered[T]</code> trait.
|
||||
*
|
||||
*
|
||||
* @author Matthias Zenger
|
||||
* @version 1.0, 03/05/2004
|
||||
*/
|
||||
//[serializable, cloneable]
|
||||
class PriorityQueue[A <% Ordered[A]] extends ResizableArray[A] with java.io.Serializable {
|
||||
|
||||
[serializable, cloneable]
|
||||
class PriorityQueue[A <% Ordered[A]] extends ResizableArray[A] {
|
||||
size = size + 1; // we do not use array(0)
|
||||
|
||||
|
||||
protected def fixUp(as: Array[A], m: Int): Unit = {
|
||||
var k: Int = m;
|
||||
while ((k > 1) && (as(k / 2) < as(k))) {
|
||||
|
|
Loading…
Reference in New Issue