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-2001. All Rights Reserved.
18 *
19 * THIS NOTICE MUST BE INCLUDED ON ANY COPY OF THIS FILE
20 */
21
22 package zeus.concepts;
23
24
25 public class FIPA_AP_Description {
26
27
28 private String name = null;
29 private String dynamic = null;
30 private String mobility = null;
31 private FIPA_Transport_Profile transportProfile = null;
32
33
34 public void setName (String name) {
35 this.name = name;
36 }
37
38
39 public String getName () {
40 return this.name;
41 }
42
43
44 /***
45 it is possible that this should be only boolean, but I am not sure...
46 */
47 public void setDynamic (String dynamic) {
48 this.dynamic = dynamic;
49 }
50
51
52 public void setDynamic (boolean dyn) {
53 if (dyn)
54 this.dynamic = new String ("true");
55 else
56 this.dynamic = new String ("false");
57 }
58
59
60 public String getDynamic () {
61 return this.dynamic;
62 }
63
64
65 /***
66 it is possible that this should be only boolean, but I am not sure...
67 */
68 public void setMobility (String mobility) {
69 this.mobility = mobility;
70 }
71
72
73 public void setMobility (boolean mob) {
74 if (mob)
75 this.mobility = new String ("true");
76 else
77 this.mobility = new String ("false");
78 }
79
80
81 public String getMobility () {
82 return this.mobility;
83 }
84
85
86 public void setTransportProfile (FIPA_Transport_Profile transportProfile) {
87 this.transportProfile = transportProfile;
88 }
89
90
91 /***
92 returns a formatted String suitable for transmission to other
93 FIPA agents.
94 */
95 public String toString () {
96 String retVal = new String ("(ap-description ");
97 if (name != null)
98 retVal += " :name //\"" + this.name +"//\""; //HAP NAME - CHECK PARSER
99 if (dynamic != null)
100 retVal += " :dynamic " + this.dynamic;
101 if (mobility != null)
102 retVal += " :mobility " + this.mobility;
103 if (transportProfile != null)
104 retVal += " :transport-profile " + transportProfile.toString();
105 retVal += ") ";
106 return retVal;
107 }
108 }