File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
library/src/com/lidroid/xutils/util/core Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -47,15 +47,15 @@ public Set<K1> getFirstKeys() {
47
47
return k1_k2V_map .keySet ();
48
48
}
49
49
50
+ public ConcurrentHashMap <K2 , V > get (K1 key1 ) {
51
+ return k1_k2V_map .get (key1 );
52
+ }
53
+
50
54
public V get (K1 key1 , K2 key2 ) {
51
55
ConcurrentHashMap <K2 , V > k2_v = k1_k2V_map .get (key1 );
52
56
return k2_v == null ? null : k2_v .get (key2 );
53
57
}
54
58
55
- public ConcurrentHashMap <K2 , V > get (K1 key1 ) {
56
- return k1_k2V_map .get (key1 );
57
- }
58
-
59
59
public boolean containsKey (K1 key1 , K2 key2 ) {
60
60
if (k1_k2V_map .containsKey (key1 )) {
61
61
return k1_k2V_map .get (key1 ).containsKey (key2 );
@@ -67,6 +67,16 @@ public boolean containsKey(K1 key1) {
67
67
return k1_k2V_map .containsKey (key1 );
68
68
}
69
69
70
+ public int size () {
71
+ if (k1_k2V_map .size () == 0 ) return 0 ;
72
+
73
+ int result = 0 ;
74
+ for (ConcurrentHashMap <K2 , V > k2V_map : k1_k2V_map .values ()) {
75
+ result += k2V_map .size ();
76
+ }
77
+ return result ;
78
+ }
79
+
70
80
public void clear () {
71
81
if (k1_k2V_map .size () > 0 ) {
72
82
for (ConcurrentHashMap <K2 , V > k2V_map : k1_k2V_map .values ()) {
You can’t perform that action at this time.
0 commit comments