EMMA Coverage Report (generated Tue Apr 17 08:51:20 BST 2007)
[all classes][org.jtoolkit.essence.utils.impl]

COVERAGE SUMMARY FOR SOURCE FILE [MapOfMap.java]

nameclass, %method, %block, %line, %
MapOfMap.java100% (1/1)100% (4/4)100% (42/42)100% (8/8)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class MapOfMap100% (1/1)100% (4/4)100% (42/42)100% (8/8)
MapOfMap (): void 100% (1/1)100% (8/8)100% (2/2)
get (Object): Map 100% (1/1)100% (6/6)100% (1/1)
keySet (): Set 100% (1/1)100% (4/4)100% (1/1)
put (Object, Object, Object): void 100% (1/1)100% (24/24)100% (4/4)

1package org.jtoolkit.essence.utils.impl;
2 
3/*
4   Copyright 2006 Peter Lawrey
5 
6   Licensed under the Apache License, Version 2.0 (the "License");
7   you may not use this file except in compliance with the License.
8   You may obtain a copy of the License at
9 
10       http://www.apache.org/licenses/LICENSE-2.0
11 
12   Unless required by applicable law or agreed to in writing, software
13   distributed under the License is distributed on an "AS IS" BASIS,
14   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   See the License for the specific language governing permissions and
16   limitations under the License.
17*/
18import org.jetbrains.annotations.NotNull;
19 
20import java.util.LinkedHashMap;
21import java.util.Map;
22import java.util.Set;
23 
24/**
25 * @author Peter Lawrey
26 */
27public class MapOfMap<K1, K2, V>  {
28    private final Map<K1, Map<K2, V>> backing = new LinkedHashMap<K1, Map<K2, V>>();
29    public void put(@NotNull K1 key, @NotNull K2 key2, V value) {
30        Map<K2, V> map = backing.get(key);
31        if (map == null) backing.put(key, map = new LinkedHashMap<K2, V>());
32        map.put(key2, value);
33    }
34 
35/*
36    @Nullable public V remove(@NotNull K1 key, @NotNull K2 key2) {
37        Map<K2, V> map = backing.get(key);
38        if (map == null) return null;
39        V prev = map.remove(key2);
40        if (map.isEmpty())
41            backing.remove(key);
42        return prev;
43    }
44*/
45 
46    public Set<K1> keySet() {
47        return backing.keySet();
48    }
49 
50    public Map<K2, V> get(K1 key1) {
51        return backing.get(key1);
52    }
53}

[all classes][org.jtoolkit.essence.utils.impl]
EMMA 2.0.5312 (C) Vladimir Roubtsov