Skip to content

Commit 22c1514

Browse files
author
michelou
committed
3rd round of clean ups (see r25285, r25292)
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25293 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
1 parent 9f6e8ee commit 22c1514

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+652
-829
lines changed

src/actors/scala/actors/Actor.scala

Lines changed: 113 additions & 164 deletions
Large diffs are not rendered by default.

src/actors/scala/actors/ActorProxy.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ package scala.actors
1212
import java.lang.Thread
1313

1414
/**
15-
* Provides a dynamic actor proxy for normal
16-
* Java threads.
15+
* Provides a dynamic actor proxy for normal Java threads.
1716
*
1817
* @author Philipp Haller
1918
*/
@@ -22,7 +21,7 @@ private[actors] class ActorProxy(t: Thread, override final val scheduler: ISched
2221
def act() {}
2322

2423
/**
25-
* Terminates with exit reason <code>'normal</code>.
24+
* Terminates with exit reason `'normal`.
2625
*/
2726
override def exit(): Nothing = {
2827
shouldExit = false

src/actors/scala/actors/CanReply.scala

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,41 +21,38 @@ trait CanReply[-T, +R] {
2121
type Future[+P] <: () => P
2222

2323
/**
24-
* Sends <code>msg</code> to this $actor and
25-
* awaits reply (synchronous).
24+
* Sends `msg` to this $actor and awaits reply (synchronous).
2625
*
2726
* @param msg the message to be sent
2827
* @return the reply
2928
*/
3029
def !?(msg: T): R
3130

3231
/**
33-
* Sends <code>msg</code> to this $actor and
34-
* awaits reply (synchronous) within <code>msec</code>
35-
* milliseconds.
32+
* Sends `msg` to this $actor and awaits reply (synchronous) within
33+
* `msec` milliseconds.
3634
*
3735
* @param msec the time span before timeout
3836
* @param msg the message to be sent
39-
* @return <code>None</code> in case of timeout, otherwise
40-
* <code>Some(x)</code> where <code>x</code> is the reply
37+
* @return `None` in case of timeout, otherwise
38+
* `Some(x)` where `x` is the reply
4139
*/
4240
def !?(msec: Long, msg: T): Option[R]
4341

4442
/**
45-
* Sends <code>msg</code> to this $actor and
46-
* immediately returns a future representing the reply value.
43+
* Sends `msg` to this $actor and immediately returns a future representing
44+
* the reply value.
4745
*
4846
* @param msg the message to be sent
4947
* @return the future
5048
*/
5149
def !!(msg: T): Future[R]
5250

5351
/**
54-
* Sends <code>msg</code> to this $actor and
55-
* immediately returns a future representing the reply value.
56-
* The reply is post-processed using the partial function
57-
* <code>handler</code>. This also allows to recover a more
58-
* precise type for the reply value.
52+
* Sends `msg` to this $actor and immediately returns a future representing
53+
* the reply value. The reply is post-processed using the partial function
54+
* `handler`. This also allows to recover a more precise type for the reply
55+
* value.
5956
*
6057
* @param msg the message to be sent
6158
* @param handler the function to be applied to the response

src/actors/scala/actors/Channel.scala

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@
66
** |/ **
77
\* */
88

9-
109
package scala.actors
1110

1211
import scala.concurrent.SyncVar
1312

1413
/**
15-
* Used to pattern match on values that were sent
16-
* to some channel <code>Chan<sub>n</sub></code> by the current
17-
* actor <code>self</code>.
14+
* Used to pattern match on values that were sent to some channel `Chan,,n,,`
15+
* by the current actor `self`.
1816
*
1917
* @example {{{
2018
* receive {
@@ -28,9 +26,8 @@ import scala.concurrent.SyncVar
2826
case class ! [a](ch: Channel[a], msg: a)
2927

3028
/**
31-
* Provides a means for typed communication among
32-
* actors. Only the actor creating an instance of a
33-
* <code>Channel</code> may receive from it.
29+
* Provides a means for typed communication among actors. Only the
30+
* actor creating an instance of a `Channel` may receive from it.
3431
*
3532
* @author Philipp Haller
3633
*

src/actors/scala/actors/DaemonActor.scala

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ package scala.actors
1010

1111
import scheduler.DaemonScheduler
1212

13-
/**
13+
/**
1414
* Base trait for actors with daemon semantics.
15-
* Unlike a regular <code>Actor</code>, an active <code>DaemonActor</code> will
16-
* not prevent an application terminating, much like a daemon thread.
1715
*
18-
* @author Erik Engbrecht
19-
*/
20-
trait DaemonActor extends Actor {
16+
* Unlike a regular `Actor`, an active `DaemonActor` will not
17+
* prevent an application terminating, much like a daemon thread.
18+
*
19+
* @author Erik Engbrecht
20+
*/
21+
trait DaemonActor extends Actor {
2122
override def scheduler: IScheduler = DaemonScheduler
2223
}

src/actors/scala/actors/IScheduler.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@
1010
package scala.actors
1111

1212
/**
13-
* A common interface
14-
* for all schedulers used to execute actor tasks.
13+
* A common interface for all schedulers used to execute actor tasks.
1514
*
16-
* Subclasses of <code>Actor</code> that override its
17-
* <code>scheduler</code> member must provide
18-
* an <code>IScheduler</code> implementation.
15+
* Subclasses of `Actor` that override its `scheduler` member must provide
16+
* an `IScheduler` implementation.
1917
*
2018
* @author Philipp Haller
2119
*/
@@ -27,7 +25,7 @@ trait IScheduler {
2725
*/
2826
def execute(fun: => Unit): Unit
2927

30-
/** Submits a <code>Runnable</code> for execution.
28+
/** Submits a `Runnable` for execution.
3129
*
3230
* @param task the task to be executed
3331
*/

src/actors/scala/actors/MessageQueue.scala

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66
** |/ **
77
\* */
88

9-
109
package scala.actors
1110

1211
/**
13-
* This class is used by our efficient message queue
14-
* implementation.
12+
* This class is used by our efficient message queue implementation.
1513
*
1614
* @author Philipp Haller
1715
*/
@@ -28,10 +26,9 @@ private[actors] class MQueueElement[Msg >: Null](val msg: Msg, val session: Outp
2826
}
2927

3028
/**
31-
* The class <code>MessageQueue</code> provides an efficient
32-
* implementation of a message queue specialized for this actor
33-
* library. Classes in this package are supposed to be the only
34-
* clients of this class.
29+
* The class `MessageQueue` provides an efficient implementation of a message
30+
* queue specialized for this actor library. Classes in this package are
31+
* supposed to be the only clients of this class.
3532
*
3633
* @author Philipp Haller
3734
*/
@@ -107,7 +104,7 @@ private[actors] class MQueue[Msg >: Null](protected val label: String) {
107104
acc
108105
}
109106

110-
/** Returns the n-th message that satisfies the predicate <code>p</code>
107+
/** Returns the n-th message that satisfies the predicate `p`
111108
* without removing it.
112109
*/
113110
def get(n: Int)(p: Msg => Boolean): Option[Msg] = {
@@ -129,8 +126,8 @@ private[actors] class MQueue[Msg >: Null](protected val label: String) {
129126
def remove(n: Int)(p: (Msg, OutputChannel[Any]) => Boolean): Option[(Msg, OutputChannel[Any])] =
130127
removeInternal(n)(p) map (x => (x.msg, x.session))
131128

132-
/** Extracts the first message that satisfies the predicate <code>p</code>
133-
* or <code>null</code> if <code>p</code> fails for all of them.
129+
/** Extracts the first message that satisfies the predicate `p`
130+
* or `'''null'''` if `p` fails for all of them.
134131
*/
135132
def extractFirst(p: (Msg, OutputChannel[Any]) => Boolean): MQueueElement[Msg] =
136133
removeInternal(0)(p) orNull

src/actors/scala/actors/OutputChannel.scala

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
** |/ **
77
\* */
88

9-
109
package scala.actors
1110

1211
/**
@@ -19,14 +18,14 @@ package scala.actors
1918
trait OutputChannel[-Msg] {
2019

2120
/**
22-
* Sends <code>msg</code> to this $actor (asynchronous).
21+
* Sends `msg` to this $actor (asynchronous).
2322
*
2423
* @param msg the message to send
2524
*/
2625
def !(msg: Msg): Unit
2726

2827
/**
29-
* Sends <code>msg</code> to this $actor (asynchronous) supplying
28+
* Sends `msg` to this $actor (asynchronous) supplying
3029
* explicit reply destination.
3130
*
3231
* @param msg the message to send
@@ -35,14 +34,14 @@ trait OutputChannel[-Msg] {
3534
def send(msg: Msg, replyTo: OutputChannel[Any]): Unit
3635

3736
/**
38-
* Forwards <code>msg</code> to this $actor (asynchronous).
37+
* Forwards `msg` to this $actor (asynchronous).
3938
*
4039
* @param msg the message to forward
4140
*/
4241
def forward(msg: Msg): Unit
4342

4443
/**
45-
* Returns the <code>Actor</code> that is receiving from this $actor.
44+
* Returns the `Actor` that is receiving from this $actor.
4645
*/
4746
def receiver: Actor
4847
}

src/actors/scala/actors/ReactChannel.scala

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ private[actors] class ReactChannel[Msg](receiver: ReplyReactor) extends InputCha
2626
}
2727

2828
/**
29-
* Sends a message to this <code>ReactChannel</code>
30-
* (asynchronous) supplying explicit reply destination.
29+
* Sends a message to this `ReactChannel` (asynchronous) supplying
30+
* explicit reply destination.
3131
*
3232
* @param msg the message to send
3333
* @param replyTo the reply destination
@@ -37,17 +37,17 @@ private[actors] class ReactChannel[Msg](receiver: ReplyReactor) extends InputCha
3737
}
3838

3939
/**
40-
* Forwards <code>msg</code> to <code>this</code> keeping the
41-
* last sender as sender instead of <code>self</code>.
40+
* Forwards `msg` to `'''this'''` keeping the last sender as sender
41+
* instead of `self`.
4242
*/
4343
def forward(msg: Msg) {
4444
receiver forward SendToReactor(this, msg)
4545
}
4646

4747
/**
48-
* Receives a message from this <code>ReactChannel</code>.
49-
* <p>
50-
* This method never returns. Therefore, the rest of the computation
48+
* Receives a message from this `ReactChannel`.
49+
*
50+
* This method ''never'' returns. Therefore, the rest of the computation
5151
* has to be contained in the actions of the partial function.
5252
*
5353
* @param f a partial function with message patterns and actions
@@ -61,10 +61,9 @@ private[actors] class ReactChannel[Msg](receiver: ReplyReactor) extends InputCha
6161
}
6262

6363
/**
64-
* Receives a message from this <code>ReactChannel</code> within
65-
* a certain time span.
66-
* <p>
67-
* This method never returns. Therefore, the rest of the computation
64+
* Receives a message from this `ReactChannel` within a certain time span.
65+
*
66+
* This method ''never'' returns. Therefore, the rest of the computation
6867
* has to be contained in the actions of the partial function.
6968
*
7069
* @param msec the time span before timeout
@@ -81,7 +80,7 @@ private[actors] class ReactChannel[Msg](receiver: ReplyReactor) extends InputCha
8180
}
8281

8382
/**
84-
* Receives a message from this <code>ReactChannel</code>.
83+
* Receives a message from this `ReactChannel`.
8584
*
8685
* @param f a partial function with message patterns and actions
8786
* @return result of processing the received value
@@ -96,8 +95,7 @@ private[actors] class ReactChannel[Msg](receiver: ReplyReactor) extends InputCha
9695
}
9796

9897
/**
99-
* Receives a message from this <code>ReactChannel</code> within a certain
100-
* time span.
98+
* Receives a message from this `ReactChannel` within a certain time span.
10199
*
102100
* @param msec the time span before timeout
103101
* @param f a partial function with message patterns and actions
@@ -114,7 +112,7 @@ private[actors] class ReactChannel[Msg](receiver: ReplyReactor) extends InputCha
114112
}
115113

116114
/**
117-
* Receives the next message from this <code>ReactChannel</code>.
115+
* Receives the next message from this `ReactChannel`.
118116
*/
119117
def ? : Msg = receive {
120118
case x => x

src/actors/scala/actors/ReplyReactor.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
** |/ **
77
\* */
88

9-
109
package scala.actors
1110

1211
import java.util.{Timer, TimerTask}
1312

1413
/**
15-
* Extends the [[scala.actors.Reactor]]
16-
* trait with methods to reply to the sender of a message.
17-
* Sending a message to a <code>ReplyReactor</code> implicitly
18-
* passes a reference to the sender together with the message.
14+
* Extends the [[scala.actors.Reactor]] trait with methods to reply to the
15+
* sender of a message.
16+
*
17+
* Sending a message to a `ReplyReactor` implicitly passes a reference to
18+
* the sender together with the message.
1919
*
2020
* @author Philipp Haller
2121
*
@@ -43,7 +43,7 @@ trait ReplyReactor extends Reactor[Any] with ReactorCanReply {
4343
protected[actors] def sender: OutputChannel[Any] = senders.head
4444

4545
/**
46-
* Replies with <code>msg</code> to the sender.
46+
* Replies with `msg` to the sender.
4747
*/
4848
protected[actors] def reply(msg: Any) {
4949
sender ! msg

0 commit comments

Comments
 (0)