class Counter as abstract datatype;
authorwenzelm
Sat Oct 22 19:00:03 2011 +0200 (2011-10-22 ago)
changeset 4524327466646a7a3
parent 45242 401f91ed8a93
child 45244 c149b61bc372
class Counter as abstract datatype;
src/Pure/Concurrent/counter.scala
src/Pure/PIDE/document.scala
src/Pure/System/system_channel.scala
     1.1 --- a/src/Pure/Concurrent/counter.scala	Sat Oct 22 16:57:24 2011 +0200
     1.2 +++ b/src/Pure/Concurrent/counter.scala	Sat Oct 22 19:00:03 2011 +0200
     1.3 @@ -12,9 +12,10 @@
     1.4  object Counter
     1.5  {
     1.6    type ID = Long
     1.7 +  def apply(): Counter = new Counter
     1.8  }
     1.9  
    1.10 -class Counter
    1.11 +class Counter private
    1.12  {
    1.13    private var count: Counter.ID = 0
    1.14  
     2.1 --- a/src/Pure/PIDE/document.scala	Sat Oct 22 16:57:24 2011 +0200
     2.2 +++ b/src/Pure/PIDE/document.scala	Sat Oct 22 19:00:03 2011 +0200
     2.3 @@ -23,7 +23,7 @@
     2.4    type Exec_ID = ID
     2.5  
     2.6    val no_id: ID = 0
     2.7 -  val new_id = new Counter
     2.8 +  val new_id = Counter()
     2.9  
    2.10  
    2.11  
     3.1 --- a/src/Pure/System/system_channel.scala	Sat Oct 22 16:57:24 2011 +0200
     3.2 +++ b/src/Pure/System/system_channel.scala	Sat Oct 22 19:00:03 2011 +0200
     3.3 @@ -30,7 +30,7 @@
     3.4  
     3.5  object Fifo_Channel
     3.6  {
     3.7 -  private val next_fifo = new Counter
     3.8 +  private val next_fifo = Counter()
     3.9  }
    3.10  
    3.11  class Fifo_Channel extends System_Channel