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

COVERAGE SUMMARY FOR SOURCE FILE [OutlierFilteredFactory.java]

nameclass, %method, %block, %line, %
OutlierFilteredFactory.java100% (1/1)12%  (1/8)26%  (15/58)29%  (4/14)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class OutlierFilteredFactory100% (1/1)12%  (1/8)26%  (15/58)29%  (4/14)
canFilter (Collection, Number): boolean 0%   (0/1)0%   (0/9)0%   (0/1)
convertToType (String): Double 0%   (0/1)0%   (0/4)0%   (0/1)
getFilterFactoryID (): String 0%   (0/1)0%   (0/2)0%   (0/1)
getFilteredCollection (Collection): AbstractMeasurementsCollection 0%   (0/1)0%   (0/6)0%   (0/1)
getFilteredCollection (Collection, Number): AbstractMeasurementsCollection 0%   (0/1)0%   (0/15)0%   (0/3)
getProperties (): Properties 0%   (0/1)0%   (0/3)0%   (0/1)
setProperties (Properties): void 0%   (0/1)0%   (0/4)0%   (0/2)
OutlierFilteredFactory (): void 100% (1/1)100% (15/15)100% (4/4)

1package de.uka.ipd.sdq.sensorframework.filter;
2 
3import java.util.Collection;
4import java.util.Properties;
5 
6import de.uka.ipd.sdq.sensorframework.entities.Measurement;
7 
8public class OutlierFilteredFactory implements IFilteredCollectionFactory {
9        
10        /** The properties settings for this filtered collection */
11        protected Properties filterProperties = new Properties();
12 
13        /** The property "outlier". */
14        private static final String OUTLIER = "Outlier removal";
15        /** Default outlier to use. */
16        private static final double DEFAULT_OUTLIER = 0.1;
17        
18        /**
19         * Initializes a new OutlierFilteredFactory without properties.
20         */
21        public OutlierFilteredFactory(){
22                filterProperties.put(OUTLIER, DEFAULT_OUTLIER);
23        }
24 
25        /** {@inheritDoc}
26         */
27        public AbstractMeasurementsCollection getFilteredCollection(
28                        Collection<Measurement> filtrate) {
29                return new OutlierFilteredCollection(filtrate, DEFAULT_OUTLIER);
30        }
31 
32        /** {@inheritDoc}
33         */
34        public Properties getProperties() {
35                return filterProperties;
36        }
37 
38        /** {@inheritDoc}
39         */
40        public void setProperties(Properties newProperties) {
41                filterProperties = newProperties;
42        }
43 
44        /**
45         * {@inheritDoc}
46         */
47        public boolean canFilter(Collection<Measurement> filtrate, Number attribute) {
48                return attribute.doubleValue() < 1.0;
49        }
50 
51        /**
52         * {@inheritDoc}
53         */
54        public AbstractMeasurementsCollection getFilteredCollection(
55                        Collection<Measurement> filtrate, Number parameter) {
56                        filterProperties.put(OUTLIER, parameter.doubleValue());
57                        return new OutlierFilteredCollection(filtrate, parameter
58                                        .doubleValue());
59        }
60 
61        /**
62         * {@inheritDoc}
63         */
64        public String getFilterFactoryID() {
65                return "Outlier Filter";
66        }
67 
68        /** {@inheritDoc}
69         */
70        public Double convertToType(String type) {
71                return Double.parseDouble(type);
72        }
73}

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