View Javadoc

1   /*
2   * The contents of this file are subject to the BT "ZEUS" Open Source
3   * Licence (L77741), Version 1.0 (the "Licence"); you may not use this file
4   * except in compliance with the Licence. You may obtain a copy of the Licence
5   * from $ZEUS_INSTALL/licence.html or alternatively from
6   * http://www.labs.bt.com/projects/agents/zeus/licence.htm
7   *
8   * Except as stated in Clause 7 of the Licence, software distributed under the
9   * Licence is distributed WITHOUT WARRANTY OF ANY KIND, either express or
10  * implied. See the Licence for the specific language governing rights and
11  * limitations under the Licence.
12  *
13  * The Original Code is within the package zeus.*.
14  * The Initial Developer of the Original Code is British Telecommunications
15  * public limited company, whose registered office is at 81 Newgate Street,
16  * London, EC1A 7AJ, England. Portions created by British Telecommunications
17  * public limited company are Copyright 1996-9. All Rights Reserved.
18  *
19  * THIS NOTICE MUST BE INCLUDED ON ANY COPY OF THIS FILE
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