EMMA Coverage Report (generated Sat Jul 01 16:38:45 PDT 2006)
[all classes][jade.jademx.config.jademx.onto]

COVERAGE SUMMARY FOR SOURCE FILE [ConfigPlatform.java]

nameclass, %method, %block, %line, %
ConfigPlatform.java100% (1/1)100% (8/8)100% (138/138)100% (45/45)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ConfigPlatform100% (1/1)100% (8/8)100% (138/138)100% (45/45)
ConfigPlatform (): void 100% (1/1)100% (9/9)100% (4/4)
addAgentSpecifier (ConfigAgentSpecifier): void 100% (1/1)100% (15/15)100% (4/4)
addOption (String): void 100% (1/1)100% (15/15)100% (4/4)
getAgentSpecifiers (): List 100% (1/1)100% (3/3)100% (1/1)
getOptions (): List 100% (1/1)100% (3/3)100% (1/1)
setAgentSpecifiers (List): void 100% (1/1)100% (4/4)100% (2/2)
setOptions (List): void 100% (1/1)100% (4/4)100% (2/2)
toString (): String 100% (1/1)100% (85/85)100% (27/27)

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 
18package jade.jademx.config.jademx.onto;
19 
20import jade.content.Concept;
21import jade.util.leap.Iterator;
22import jade.util.leap.LinkedList;
23import 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 */
30public class ConfigPlatform implements Concept  {
31 
32    /** list of options of type String */
33    private List options = null;    
34    /** list of arguments of type Argument */
35    private List agentSpecifiers = null;
36 
37    /**
38     * Constructor 
39     */
40    public ConfigPlatform() {
41    }
42    
43    /**
44     * add one option at a time
45     * @param option option to add
46     */
47    public void addOption( String option ) {
48        if ( null == options ) {
49            options = new LinkedList();
50        }
51        options.add( option );
52    }
53 
54    /**
55     * @return Returns the options.
56     */
57    public List getOptions() {
58        return options;
59    }
60 
61    /**
62     * @param options The options to set.
63     */
64    public void setOptions(List options) {
65        this.options = options;
66    }
67 
68    /**
69     * add one agent specifier at a time
70     * @param agentSpecifier agent specifier to add
71     */
72    public void addAgentSpecifier( ConfigAgentSpecifier agentSpecifier ) {
73        if ( null == agentSpecifiers ) {
74            agentSpecifiers = new LinkedList();
75        }
76        agentSpecifiers.add( agentSpecifier );
77    }
78 
79    /**
80     * @param arguments The arguments to set.
81     */
82    public void setAgentSpecifiers(List arguments) {
83        this.agentSpecifiers = arguments;
84    }
85 
86    /**
87     * @return Returns the arguments.
88     */
89    public List getAgentSpecifiers() {
90        return agentSpecifiers;
91    }
92 
93    /* (non-Javadoc)
94     * @see java.lang.Object#toString()
95     */
96    public String toString() {
97        StringBuffer sb = new StringBuffer();
98        sb.append( "Platform[" );
99        if ( null != options ) {
100            sb.append("(");
101            Iterator optionI = options.iterator();
102            boolean first = true;
103            while ( optionI.hasNext() ) {
104                if ( first ) {
105                    first = false;
106                }
107                else {
108                    sb.append(",");
109                }
110                sb.append( optionI.next().toString() );
111            }
112            sb.append(")");
113        }   
114        if ( null != agentSpecifiers ) {
115            sb.append(",");
116            Iterator argumentsI = agentSpecifiers.iterator();
117            boolean first = true;
118            while ( argumentsI.hasNext() ) {
119                if ( first ) {
120                    first = false;
121                }
122                else {
123                    sb.append(",");
124                }
125                sb.append( argumentsI.next().toString() );
126            }
127        }
128        sb.append("]");
129        return sb.toString();
130    }
131 
132}

[all classes][jade.jademx.config.jademx.onto]
EMMA 2.0.5312 (C) Vladimir Roubtsov