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

COVERAGE SUMMARY FOR SOURCE FILE [False.java]

nameclass, %method, %block, %line, %
False.java100% (1/1)30%  (3/10)5%   (10/184)14%  (4/29)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class False100% (1/1)30%  (3/10)5%   (10/184)14%  (4/29)
$SWITCH_TABLE$com$hammurapi$extract$ComparisonResult$Type (): int [] 0%   (0/1)0%   (0/97)0%   (0/1)
compareTo (Extractor): ComparisonResult 0%   (0/1)0%   (0/65)0%   (0/19)
extract (Object, Map, Object []): Boolean 0%   (0/1)0%   (0/2)0%   (0/1)
getCost (): double 0%   (0/1)0%   (0/2)0%   (0/1)
isContextDependent (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
parameterIndices (): Set 0%   (0/1)0%   (0/2)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/4)0%   (0/1)
<static initializer> 100% (1/1)100% (5/5)100% (2/2)
False (): void 100% (1/1)100% (3/3)100% (2/2)
getInstance (): False 100% (1/1)100% (2/2)100% (1/1)

1package com.hammurapi.extract;
2 
3import java.util.Collections;
4import java.util.Map;
5import java.util.Set;
6 
7 
8/**
9 * Predicate which always evaluates to true. This predicate is primarily used for
10 * comparison 
11 * @author Pavel Vlasov
12 *
13 * @param <T>
14 * @param <C>
15 */
16public class False<T, C> implements Predicate<T, C> {
17        
18        private False() {
19                // Singleton
20        }
21        
22        private static False<?, ?> INSTANCE = new False<Object, Object>();
23        
24        @SuppressWarnings("unchecked")
25        public static <T, C> False<T, C> getInstance() {
26                return (False<T, C>) INSTANCE;
27        }
28 
29        public ComparisonResult compareTo(Extractor<T, Boolean, C> other) {
30                if (other instanceof False) {
31                        return ComparisonResult.EQUAL_NM;
32                }
33                
34                if (other instanceof True) {
35                        return ComparisonResult.OPPOSITE_NM;
36                }
37                
38                if (other == null) {
39                        return ComparisonResult.NOT_EQUAL_NM;
40                }
41                
42                if (other instanceof Constant) {
43                        if (Boolean.FALSE.equals(((Constant) other).getValue())) {
44                                return ComparisonResult.EQUAL_NM;
45                        }
46                        if (Boolean.TRUE.equals(((Constant) other).getValue())) {
47                                return ComparisonResult.OPPOSITE_NM;
48                        }
49                }
50                
51                ComparisonResult cr = other.compareTo(this);
52                switch (cr.getType()) {
53                case EQUAL:
54                case NOT_EQUAL:
55                case OPPOSITE:
56                        return cr;
57                case LESS_RESTRICTIVE:
58                        return ComparisonResult.MORE_RESTRICTIVE_NM;
59                case MORE_RESTRICTIVE:
60                        return ComparisonResult.LESS_RESTRICTIVE_NM;
61                case OPPOSITE_LESS_RESTRICTIVE:
62                        return ComparisonResult.OPPOSITE_MORE_RESTRICTIVE_NM;
63                case OPPOSITE_MORE_RESTRICTIVE:
64                        return ComparisonResult.OPPOSITE_LESS_RESTRICTIVE_NM;
65                default:
66                        throw new IllegalArgumentException("Unexpected comparison type: "+cr.getType());
67                }
68                
69        }
70 
71        public Boolean extract(
72                        C context,
73                        Map<C, Map<Extractor<T, ? super Boolean, C>, ? super Boolean>> cache,
74                        T... obj) {
75                return Boolean.TRUE;
76        }
77 
78        public boolean isContextDependent() {
79                return false;
80        }
81 
82        public Set<Integer> parameterIndices() {
83                return Collections.emptySet();
84        }
85 
86        @Override
87        public String toString() {
88                return getClass().getName();
89        }
90        
91        @Override
92        public double getCost() {
93                return 0;
94        }
95        
96}

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