1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
import scala.collection.immutable.{Map, TreeMap, ListMap, ListSet, Set}
import scala.collection.{immutable=>imm, mutable=>mut}
case class HashTreeSet[A](map: imm.Map[A, Unit])
extends Object
with imm.Set[A]
{
def this() = this(null)
def size = map.size
def +(elem: A) = new HashTreeSet(map + elem -> ())
def -(elem: A) = new HashTreeSet(map - elem)
def contains(elem: A) = map.isDefinedAt(elem)
def iterator = map.iterator.map(._1)
def empty:imm.Set[A] = new HashTreeSet[A]()
}
abstract class Goal2 {
type Question
val question: Question
type Answer
def initialAnswer: Answer
}
abstract class AbstractRespondersGoal
extends Goal2 // TYPEFIX -- comment out the extends Goal2
{
}
class RespondersGoal(
val question: String,
rcvr: String,
signature: String,
codebase: String)
extends AbstractRespondersGoal
{
type Question = String
type Answer = imm.Set[String]
val initialAnswer = new HashTreeSet[String]()// TYPEFIX .asInstanceOf[Answer]
}
class SingleResponderGoal(val question: String, responder: String)
extends AbstractRespondersGoal
{
type Question = String
type Answer = Set[String]
val initialAnswer = (new ListSet[String])//TYPEFIX .asInstanceOf[Answer]
}
class RespondersGoalSet
//extends OneKindGoalSet
{
type Question = String
type Answer = imm.Set[String]
type MyGoal = AbstractRespondersGoal
var selector: Boolean = _
def newGoal(question: String) //TYPEFIX :MyGoal
= {
selector match {
// case StaticMethodSelector(method: MethodRef) =>
case true =>
new SingleResponderGoal(null, null)
// case DynamicMethodSelector(signature: MethodSignature) => {
case false => {
new RespondersGoal(null, null,null,null)
}
}
}
}
|