EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.tcfmoop.config]

COVERAGE SUMMARY FOR SOURCE FILE [MaxGenerationNumberConfig.java]

nameclass, %method, %block, %line, %
MaxGenerationNumberConfig.java0%   (0/1)0%   (0/4)0%   (0/32)0%   (0/11)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class MaxGenerationNumberConfig0%   (0/1)0%   (0/4)0%   (0/32)0%   (0/11)
MaxGenerationNumberConfig (): void 0%   (0/1)0%   (0/4)0%   (0/2)
getMaximumNumberOfIterations (): int 0%   (0/1)0%   (0/4)0%   (0/1)
setMaximumNumberOfIterations (int): void 0%   (0/1)0%   (0/13)0%   (0/4)
validateConfiguration (): boolean 0%   (0/1)0%   (0/11)0%   (0/4)

1package de.uka.ipd.sdq.tcfmoop.config;
2 
3import de.uka.ipd.sdq.tcfmoop.config.exceptions.InvalidConfigException;
4 
5/**
6 * Configuration class for MaxGenerationNumber termination criterion.
7 * @author Atanas Dimitrov
8 */
9public class MaxGenerationNumberConfig extends AbstractConfiguration {
10 
11        private Integer maximumNumberOfIterations;
12        
13        public MaxGenerationNumberConfig(){
14                super(TerminationCriteriaNames.MAXIMUM_NUMBER_OF_GENERATIONS);
15                
16        }
17        
18        /**
19         * {@inheritDoc}
20         */
21        @Override
22        public boolean validateConfiguration() {
23                if(this.getTerminationCriterionName() != TerminationCriteriaNames.MAXIMUM_NUMBER_OF_GENERATIONS ||
24                   this.maximumNumberOfIterations == null){
25                        return false;
26                }else{
27                        return true;
28                }
29        }
30        
31        /**
32         * Set the maximum number of iterations that the optimization algorithm 
33         * will perform before terminating.
34         * @param maximumNumberOfIterations if parameter is less then 1, an Exception is thrown.
35         * @throws InvalidConfigException if the supplied parameter do not conform to the required conditions.
36         */
37        public void setMaximumNumberOfIterations(int maximumNumberOfIterations) throws InvalidConfigException{
38                if(maximumNumberOfIterations > 0){
39                        this.maximumNumberOfIterations = maximumNumberOfIterations;
40                }else{
41                        throw new InvalidConfigException("MaxGenerationNumberConfig.setMaximumNumberOfIterations: The supplied Parameter is < 1");
42                }
43        }
44        
45        /**
46         * Returns the number of iterations that the optimization framework should execute.
47         * @return the number of iterations that the optimization framework should execute.
48         */
49        public int getMaximumNumberOfIterations(){
50                return this.maximumNumberOfIterations;
51        }
52 
53}

[all classes][de.uka.ipd.sdq.tcfmoop.config]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov