VC完成Windows多顯示器編程的辦法。本站提示廣大學習愛好者:(VC完成Windows多顯示器編程的辦法)文章只能為提供參考,不一定能成為您想要的結果。以下是VC完成Windows多顯示器編程的辦法正文
本文實例講述了java應用hashMap緩存保留數據的辦法。分享給年夜家供年夜家參考,詳細以下:
private static final HashMap<Long, XXX> sCache = new HashMap<Long, XXX>();
private static int sId = -1;
public static void initAlbumArtCache() {
try {
//。。。
if (id != sId) {
clearCache();
sId = id;
}
} catch (RemoteException e) {
e.printStackTrace();
}
}
public static void clearCache() {
synchronized(sCache) {
sCache.clear();
}
}
public static XXX getCachedXXX(long Index, BitmapDrawable defaultBitmap) {
XXX d = null;
synchronized(sCache) {
d = sCache.get(Index);
}
if (d == null) {
//。。。
synchronized(sArtCache) {
// the cache may have changed since we checked
XXX value = sCache.get(Index);
if (value == null) {
sCache.put(Index, d);
} else {
d = value;
}
}
}
return d;
}
願望本文所述對年夜家java法式設計有所贊助。