|
25 | 25 | package com.tmall.wireless.vaf.virtualview.loader;
|
26 | 26 |
|
27 | 27 | import java.util.Map;
|
| 28 | +import java.util.concurrent.ConcurrentHashMap; |
28 | 29 |
|
29 |
| -import android.support.v4.util.ArrayMap; |
30 | 30 | import android.util.Log;
|
31 | 31 | import com.libra.TextUtils;
|
32 | 32 | import com.libra.expr.common.StringSupport;
|
|
38 | 38 | public class StringLoader extends StringBase implements StringSupport {
|
39 | 39 | final private static String TAG = "StringLoader_TMTEST";
|
40 | 40 |
|
41 |
| - private Map<String, Integer> mString2Index = new ArrayMap<>(); |
| 41 | + private Map<String, Integer> mString2Index = new ConcurrentHashMap<>(); |
42 | 42 |
|
43 |
| - private Map<Integer, String> mIndex2String = new ArrayMap<>(); |
| 43 | + private Map<Integer, String> mIndex2String = new ConcurrentHashMap<>(); |
44 | 44 |
|
45 |
| - private Map<String, Integer> mSysString2Index = new ArrayMap<>(); |
| 45 | + private Map<String, Integer> mSysString2Index = new ConcurrentHashMap<>(); |
46 | 46 |
|
47 |
| - private Map<Integer, String> mSysIndex2String = new ArrayMap<>(); |
| 47 | + private Map<Integer, String> mSysIndex2String = new ConcurrentHashMap<>(); |
48 | 48 |
|
49 | 49 | private int mCurPage;
|
50 | 50 |
|
51 |
| - |
52 |
| - |
53 | 51 | public StringLoader() {
|
54 | 52 | for (int i = 0; i < StringBase.STR_ID_SYS_KEY_COUNT; ++i) {
|
55 | 53 | mSysString2Index.put(SYS_KEYS[i], StringBase.SYS_KEYS_INDEX[i]);
|
@@ -144,25 +142,4 @@ public boolean isSysString(int id) {
|
144 | 142 | public boolean isSysString(String string) {
|
145 | 143 | return mSysString2Index.containsKey(string);
|
146 | 144 | }
|
147 |
| - |
148 |
| - //private int addNewItem(String str) { |
149 |
| - // int ret; |
150 |
| - // |
151 |
| - // Map<Integer, String> arr = (Map<Integer, String>)mIndex2StringTab[mCurPage]; |
152 |
| - // if (null == arr) { |
153 |
| - // arr = new ArrayMap<>(30); |
154 |
| - // mIndex2StringTab[mCurPage] = arr; |
155 |
| - // } |
156 |
| - // arr.add(str); |
157 |
| - // |
158 |
| - // Map<String, Integer> map = (Map<String, Integer>)mString2IndexTab[mCurPage]; |
159 |
| - // if (null == map) { |
160 |
| - // map = new HashMap<>(); |
161 |
| - // mString2IndexTab[mCurPage] = map; |
162 |
| - // } |
163 |
| - // ret = mCurPage * Common.MAX_PAGE_ITEM_COUNT + map.size(); |
164 |
| - // map.put(str, ret); |
165 |
| - // |
166 |
| - // return ret; |
167 |
| - //} |
168 | 145 | }
|
0 commit comments