gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.lib / src / main / java / org / gvsig / tools / util / UnmodifiableBasicMapAdapter.java @ 1792
History | View | Annotate | Download (959 Bytes)
1 |
/*
|
---|---|
2 |
* To change this license header, choose License Headers in Project Properties.
|
3 |
* To change this template file, choose Tools | Templates
|
4 |
* and open the template in the editor.
|
5 |
*/
|
6 |
package org.gvsig.tools.util; |
7 |
|
8 |
import java.util.Iterator; |
9 |
import java.util.Map; |
10 |
|
11 |
/**
|
12 |
*
|
13 |
* @author jjdelcerro
|
14 |
*/
|
15 |
public class UnmodifiableBasicMapAdapter<K,V> implements UnmodifiableBasicMap<K,V> { |
16 |
|
17 |
private final Map<K,V> map; |
18 |
|
19 |
public UnmodifiableBasicMapAdapter(Map<K,V> map) { |
20 |
this.map = map;
|
21 |
} |
22 |
|
23 |
@Override
|
24 |
public V get(K key) {
|
25 |
return this.map.get(key); |
26 |
} |
27 |
|
28 |
@Override
|
29 |
public int size() { |
30 |
return this.map.size(); |
31 |
} |
32 |
|
33 |
@Override
|
34 |
public boolean isEmpty() { |
35 |
return this.map.isEmpty(); |
36 |
} |
37 |
|
38 |
@Override
|
39 |
public Iterator<K> iterator() { |
40 |
return this.map.keySet().iterator(); |
41 |
} |
42 |
|
43 |
@Override
|
44 |
public boolean containsKey(K key) { |
45 |
return this.map.containsKey(key); |
46 |
} |
47 |
} |