1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package zeus.concepts;
24
25
26 public class FIPA_AMS_Management_Content {
27
28 private FIPA_AID_Address implementor = null;
29 private AMS_Description subject = null;
30 private boolean type = false;
31 private String action = null;
32 private String result = null;
33 private String context = null;
34 private String outputType = null;
35
36
37 public String getSubjectName () {
38 if (implementor != null )
39 return (implementor.getName());
40 else
41 return null;
42 }
43
44
45
46 public AMS_Description getDescription () {
47 return (subject);
48 }
49
50
51 public FIPA_AID_Address getAddress() {
52 return (subject.getName());
53 }
54
55
56
57
58 public void setContext (String context) {
59 this.context = context;
60 }
61
62
63 public void setImplementor (FIPA_AID_Address addr) {
64 implementor = addr;
65 }
66
67
68 public void setSubject (AMS_Description desc) {
69 subject = desc;
70 }
71
72
73 public void setType (boolean in) {
74 type = in;
75 }
76
77
78 public void setAction (String act) {
79 action = act;
80 }
81
82
83 public void setResult (String val) {
84 result = val;
85 }
86
87
88 public void setResult (boolean res) {
89 if (res) result = new String("true");
90 else result = new String ("false");
91 }
92
93
94 public void setOutputType (String out) {
95 this.outputType = out;
96 }
97
98
99
100 public String toString () {
101
102 String retVal = new String ();
103 if (result!=null) {
104 retVal += "(" ;
105 if (outputType != null) retVal += outputType; }
106 if (context != null ) {
107 retVal += "(" + context; }
108 if (!type)
109 retVal += "(action \n";
110 else
111 retVal += "(done \n";
112 if (implementor != null ) {
113 retVal += "(" + implementor.toFIPAString() + ")";
114 }
115 if (action!=null) {
116 retVal += "(" + action +"\n";
117 if (subject != null) {
118 retVal += subject.toString(); }
119 retVal += ")";
120 }
121 if (result!=null)
122 retVal += result+")";
123 if (context != null )
124 retVal += ")";
125 retVal +=")";
126 return (retVal);
127 }
128
129
130 }
131
132
133
134
135
136
137
138
139
140
141
142
143