EMMA Coverage Report (generated Thu Jan 20 11:39:44 EST 2011)
[all classes][com.hammurapi.extract]

COVERAGE SUMMARY FOR SOURCE FILE [MethodExtractor.java]

nameclass, %method, %block, %line, %
MethodExtractor.java0%   (0/1)0%   (0/4)0%   (0/58)0%   (0/14)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class MethodExtractor0%   (0/1)0%   (0/4)0%   (0/58)0%   (0/14)
MethodExtractor (double, TimeUnit, Method): void 0%   (0/1)0%   (0/32)0%   (0/7)
extractInternal (Object, Map, Object []): Object 0%   (0/1)0%   (0/18)0%   (0/5)
isContextDependent (): boolean 0%   (0/1)0%   (0/5)0%   (0/1)
parameterIndices (): Set 0%   (0/1)0%   (0/3)0%   (0/1)

1package com.hammurapi.extract;
2 
3import java.lang.reflect.InvocationTargetException;
4import java.lang.reflect.Method;
5import java.lang.reflect.Modifier;
6import java.util.Collections;
7import java.util.Map;
8import java.util.Set;
9import java.util.TreeSet;
10import java.util.concurrent.TimeUnit;
11 
12public class MethodExtractor<T, V, C> extends ExtractorBase<T, V, C> implements        Extractor<T, V, C> {
13        
14        private Method method;
15        private Set<Integer> parameterIndices;
16 
17        public MethodExtractor(double initialCost, TimeUnit costUnit, Method method) {
18                super(initialCost, costUnit);
19                this.method = method;
20                Set<Integer> pi = new TreeSet<Integer>();        
21                for (int i=0, l=method.getParameterTypes().length; i<l; ++i) {
22                        pi.add(i);
23                }
24                parameterIndices = Collections.unmodifiableSet(pi);
25        }
26 
27        @Override
28        public Set<Integer> parameterIndices() {
29                return parameterIndices;
30        }
31 
32        @Override
33        public boolean isContextDependent() {
34                return Modifier.isStatic(method.getModifiers());
35        }
36 
37        @SuppressWarnings("unchecked")
38        @Override
39        protected V extractInternal(
40                        C context,
41                        Map<C, Map<Extractor<T, ? super V, C>, ? super V>> cache, 
42                        T... obj) {
43                try {
44                        return (V) method.invoke(context, obj);
45                } catch (IllegalAccessException e) {
46                        throw new ExtractorException(e);
47                } catch (InvocationTargetException e) {
48                        throw new ExtractorException(e);
49                }
50        }
51        
52 
53}

[all classes][com.hammurapi.extract]
EMMA 2.0.5312 EclEmma Fix 2 (C) Vladimir Roubtsov