equal
deleted
inserted
replaced
15 { |
15 { |
16 private val table = |
16 private val table = |
17 Collections.synchronizedMap(new WeakHashMap[Any, WeakReference[Any]](initial_size)) |
17 Collections.synchronizedMap(new WeakHashMap[Any, WeakReference[Any]](initial_size)) |
18 |
18 |
19 def size: Int = table.size |
19 def size: Int = table.size |
|
20 |
|
21 override def toString: String = "Cache(" + size + ")" |
20 |
22 |
21 protected def lookup[A](x: A): Option[A] = |
23 protected def lookup[A](x: A): Option[A] = |
22 { |
24 { |
23 val ref = table.get(x) |
25 val ref = table.get(x) |
24 if (ref == null) None |
26 if (ref == null) None |