| 1 | // jademx - JADE management using JMX |
| 2 | // Copyright 2005 Caboodle Networks, Inc. |
| 3 | // |
| 4 | // This library is free software; you can redistribute it and/or |
| 5 | // modify it under the terms of the GNU Lesser General Public |
| 6 | // License as published by the Free Software Foundation; either |
| 7 | // version 2.1 of the License, or (at your option) any later version. |
| 8 | // |
| 9 | // This library is distributed in the hope that it will be useful, |
| 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | // Lesser General Public License for more details. |
| 13 | // |
| 14 | // You should have received a copy of the GNU Lesser General Public |
| 15 | // License along with this library; if not, write to the Free Software |
| 16 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
| 17 | |
| 18 | package jade.jademx.config.jademx.onto; |
| 19 | |
| 20 | import jade.content.Concept; |
| 21 | import jade.util.leap.Iterator; |
| 22 | import jade.util.leap.LinkedList; |
| 23 | import jade.util.leap.List; |
| 24 | |
| 25 | /** |
| 26 | * Class to represent an argument to an agent in the JademxConfigOntology. |
| 27 | * @author David Bernstein, <a href="http://www.caboodlenetworks.com" |
| 28 | * >Caboodle Networks, Inc.</a> |
| 29 | */ |
| 30 | public class ConfigRuntime implements Concept { |
| 31 | |
| 32 | /** list of options of type String */ |
| 33 | private List platforms = null; |
| 34 | |
| 35 | /** |
| 36 | * Constructor |
| 37 | */ |
| 38 | public ConfigRuntime() { |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * add one platform at a time |
| 43 | * @param platform platform to add |
| 44 | */ |
| 45 | public void addPlatform( ConfigPlatform platform ) { |
| 46 | if ( null == platforms ) { |
| 47 | platforms = new LinkedList(); |
| 48 | } |
| 49 | platforms.add( platform ); |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * @return Returns the options. |
| 54 | */ |
| 55 | public List getPlatforms() { |
| 56 | return platforms; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * @param options The options to set. |
| 61 | */ |
| 62 | public void setPlatforms(List options) { |
| 63 | this.platforms = options; |
| 64 | } |
| 65 | |
| 66 | /* (non-Javadoc) |
| 67 | * @see java.lang.Object#toString() |
| 68 | */ |
| 69 | public String toString() { |
| 70 | StringBuffer sb = new StringBuffer(); |
| 71 | sb.append( "Runtime[" ); |
| 72 | if ( null != platforms ) { |
| 73 | Iterator optionI = platforms.iterator(); |
| 74 | boolean first = true; |
| 75 | while ( optionI.hasNext() ) { |
| 76 | if ( first ) { |
| 77 | first = false; |
| 78 | } |
| 79 | else { |
| 80 | sb.append(","); |
| 81 | } |
| 82 | sb.append( optionI.next().toString() ); |
| 83 | } |
| 84 | } |
| 85 | sb.append("]"); |
| 86 | return sb.toString(); |
| 87 | } |
| 88 | |
| 89 | } |