From 29162dae261e4fd3281a2b0e4eccda55f58db144 Mon Sep 17 00:00:00 2001 From: michelou Date: Wed, 7 Feb 2007 13:07:33 +0000 Subject: added missing file headers --- src/library/scala/Attribute.scala | 14 +++++++------ src/library/scala/ClassfileAttribute.scala | 11 +++++----- src/library/scala/StaticAttribute.scala | 11 +++++----- src/library/scala/ref/PhantomReference.scala | 7 +++++-- src/library/scala/ref/Reference.scala | 29 +++++++++++++++++++------- src/library/scala/ref/ReferenceQueue.scala | 31 ++++++++++++++++++++-------- src/library/scala/ref/ReferenceWrapper.scala | 31 ++++++++++++++++++++-------- src/library/scala/ref/SoftReference.scala | 15 +++++++++++++- src/library/scala/ref/WeakReference.scala | 23 ++++++++++++++++----- 9 files changed, 122 insertions(+), 50 deletions(-) (limited to 'src') diff --git a/src/library/scala/Attribute.scala b/src/library/scala/Attribute.scala index 869800458d..4762e2cdf4 100644 --- a/src/library/scala/Attribute.scala +++ b/src/library/scala/Attribute.scala @@ -1,7 +1,7 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2006-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ @@ -11,10 +11,12 @@ package scala -/**

A base class for attributes. Atributes extending this class directly - * are not preserved for the Scala type checker and are also not stored as - * Java annotations in classfiles. To enable either or both of these, one needs to - * inherit from StaticAttribute or/and ClassfileAttribute. +/**

+ * A base class for attributes. Atributes extending this class directly + * are not preserved for the Scala type checker and are also not stored + * as Java annotations in classfiles. To enable either or both of these, + * one needs to inherit from StaticAttribute or/and + * ClassfileAttribute. *

* * @author Martin Odersky diff --git a/src/library/scala/ClassfileAttribute.scala b/src/library/scala/ClassfileAttribute.scala index f505906d80..51c889688b 100644 --- a/src/library/scala/ClassfileAttribute.scala +++ b/src/library/scala/ClassfileAttribute.scala @@ -1,18 +1,19 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2006-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ -// $Id: Attribute.scala 8926 2006-10-11 09:58:51 +0000 (Wed, 11 Oct 2006) dragos $ +// $Id$ package scala -/**

A base class for classfile attributes. These are stored as - * Java annotations in classfiles. +/**

+ * A base class for classfile attributes. These are stored as + * Java annotations in classfiles. *

* * @author Martin Odersky diff --git a/src/library/scala/StaticAttribute.scala b/src/library/scala/StaticAttribute.scala index 8b4815472b..1ad88faeac 100644 --- a/src/library/scala/StaticAttribute.scala +++ b/src/library/scala/StaticAttribute.scala @@ -1,18 +1,19 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2006-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ -// $Id: Attribute.scala 8926 2006-10-11 09:58:51 +0000 (Wed, 11 Oct 2006) dragos $ +// $Id$ package scala -/**

A base class for static attributes. These are available - * to the Scala typechecker, even across different compilation units. +/**

+ * A base class for static attributes. These are available + * to the Scala type checker, even across different compilation units. *

* * @author Martin Odersky diff --git a/src/library/scala/ref/PhantomReference.scala b/src/library/scala/ref/PhantomReference.scala index 39eb754081..20cd1fa093 100644 --- a/src/library/scala/ref/PhantomReference.scala +++ b/src/library/scala/ref/PhantomReference.scala @@ -1,6 +1,6 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** +** / __/ __// _ | / / / _ | (c) 2006-2007, LAMP/EPFL ** ** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** @@ -10,6 +10,9 @@ package scala.ref -class PhantomReference[+T <: AnyRef](value : T, queue : ReferenceQueue[T]) extends ReferenceWrapper[T] { +/** + * @author Sean McDirmid + */ +class PhantomReference[+T <: AnyRef](value: T, queue: ReferenceQueue[T]) extends ReferenceWrapper[T] { val underlying = new java.lang.ref.PhantomReference(value, queue.underlying) } diff --git a/src/library/scala/ref/Reference.scala b/src/library/scala/ref/Reference.scala index 30ace06b31..f59964de72 100644 --- a/src/library/scala/ref/Reference.scala +++ b/src/library/scala/ref/Reference.scala @@ -1,11 +1,24 @@ -package scala.ref; +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2006-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ +// $Id$ + +package scala.ref + +/** + * @author Sean McDirmid + */ trait Reference[+T <: AnyRef] extends Function0[T] { - def isValid : Boolean; - def apply() : T; - def get = if (!isValid) None else Some(apply()); - override def toString = if (!isValid) "" else apply().toString; - def clear : Unit; - def enqueue : Boolean; - def isEnqueued : Boolean; + def isValid: Boolean + def apply(): T + def get = if (!isValid) None else Some(apply()) + override def toString = if (!isValid) "" else apply().toString + def clear: Unit + def enqueue: Boolean + def isEnqueued: Boolean } diff --git a/src/library/scala/ref/ReferenceQueue.scala b/src/library/scala/ref/ReferenceQueue.scala index 1ed4c20af3..5f2d7a20ec 100644 --- a/src/library/scala/ref/ReferenceQueue.scala +++ b/src/library/scala/ref/ReferenceQueue.scala @@ -1,14 +1,27 @@ -package scala.ref; +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2006-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ +// $Id$ + +package scala.ref + +/** + * @author Sean McDirmid + */ class ReferenceQueue[+T <: AnyRef] { - private[ref] val underlying = new java.lang.ref.ReferenceQueue; + private[ref] val underlying = new java.lang.ref.ReferenceQueue override def toString = underlying.toString; - class Wrapper(val underlying : java.lang.ref.Reference) extends ReferenceWrapper[T]; - def Wrapper(ref : java.lang.ref.Reference) = ref match { - case null => None; - case ref => new Wrapper(ref); + class Wrapper(val underlying: java.lang.ref.Reference) extends ReferenceWrapper[T] + def Wrapper(ref: java.lang.ref.Reference) = ref match { + case null => None + case ref => new Wrapper(ref) } - def poll = Wrapper(underlying.poll); - def remove = Wrapper(underlying.remove); - def remove(timeout : Long) = Wrapper(underlying.remove(timeout)); + def poll = Wrapper(underlying.poll) + def remove = Wrapper(underlying.remove) + def remove(timeout: Long) = Wrapper(underlying.remove(timeout)) } diff --git a/src/library/scala/ref/ReferenceWrapper.scala b/src/library/scala/ref/ReferenceWrapper.scala index 95f0047efe..4546f4d8fd 100644 --- a/src/library/scala/ref/ReferenceWrapper.scala +++ b/src/library/scala/ref/ReferenceWrapper.scala @@ -1,14 +1,27 @@ -package scala.ref; +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2006-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ +// $Id$ + +package scala.ref + +/** + * @author Seam McDirmid + */ trait ReferenceWrapper[+T <: AnyRef] extends Reference[T] { - val underlying : java.lang.ref.Reference; - def isValid = underlying.get != null; + val underlying: java.lang.ref.Reference + def isValid = underlying.get != null def apply() = { - val ret = underlying.get.asInstanceOf[T]; - if (ret eq null) throw new NoSuchElementException; - ret; + val ret = underlying.get.asInstanceOf[T] + if (ret eq null) throw new NoSuchElementException + ret } - def clear = underlying.clear; - def enqueue = underlying.enqueue; - def isEnqueued = underlying.isEnqueued; + def clear = underlying.clear + def enqueue = underlying.enqueue + def isEnqueued = underlying.isEnqueued } diff --git a/src/library/scala/ref/SoftReference.scala b/src/library/scala/ref/SoftReference.scala index a19ae08f5d..8c6622c7e9 100644 --- a/src/library/scala/ref/SoftReference.scala +++ b/src/library/scala/ref/SoftReference.scala @@ -1,5 +1,18 @@ -package scala.ref; +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2006-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ +// $Id$ + +package scala.ref + +/** + * @author Sean McDirmid + */ class SoftReference[+T <: AnyRef](value : T, queue : ReferenceQueue[T]) extends ReferenceWrapper[T] { def this(value : T) = this(value, null); val underlying = diff --git a/src/library/scala/ref/WeakReference.scala b/src/library/scala/ref/WeakReference.scala index 6a27bda409..bde3a6c4fa 100644 --- a/src/library/scala/ref/WeakReference.scala +++ b/src/library/scala/ref/WeakReference.scala @@ -1,8 +1,21 @@ -package scala.ref; +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2006-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ -class WeakReference[+T <: AnyRef](value : T, queue : ReferenceQueue[T]) extends ReferenceWrapper[T] { - def this(value : T) = this(value, null); +// $Id$ + +package scala.ref + +/** + * @author Sean McDirmid + */ +class WeakReference[+T <: AnyRef](value: T, queue: ReferenceQueue[T]) extends ReferenceWrapper[T] { + def this(value: T) = this(value, null) val underlying = - if (queue == null) new java.lang.ref.WeakReference(value); - else new java.lang.ref.WeakReference(value, queue.underlying); + if (queue == null) new java.lang.ref.WeakReference(value) + else new java.lang.ref.WeakReference(value, queue.underlying) } -- cgit v1.2.3