當前位置: 首頁>>代碼示例>>Java>>正文


Java LongSparseArray.delete方法代碼示例

本文整理匯總了Java中android.support.v4.util.LongSparseArray.delete方法的典型用法代碼示例。如果您正苦於以下問題:Java LongSparseArray.delete方法的具體用法?Java LongSparseArray.delete怎麽用?Java LongSparseArray.delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v4.util.LongSparseArray的用法示例。


在下文中一共展示了LongSparseArray.delete方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getCachedDelegateDrawable

import android.support.v4.util.LongSparseArray; //導入方法依賴的package包/類
private Drawable getCachedDelegateDrawable(@NonNull Context context, long key) {
    Drawable drawable = null;
    synchronized (this.mDelegateDrawableCacheLock) {
        LongSparseArray<WeakReference<ConstantState>> cache = (LongSparseArray) this.mDelegateDrawableCaches.get(context);
        if (cache == null) {
        } else {
            WeakReference<ConstantState> wr = (WeakReference) cache.get(key);
            if (wr != null) {
                ConstantState entry = (ConstantState) wr.get();
                if (entry != null) {
                    drawable = entry.newDrawable(context.getResources());
                } else {
                    cache.delete(key);
                }
            }
        }
    }
    return drawable;
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:20,代碼來源:AppCompatDrawableManager.java

示例2: getCachedDrawable

import android.support.v4.util.LongSparseArray; //導入方法依賴的package包/類
private Drawable getCachedDrawable(@NonNull final Context context, final long key) {
    synchronized (mDrawableCacheLock) {
        final LongSparseArray<WeakReference<ConstantState>> cache
                = mDrawableCaches.get(context);
        if (cache == null) {
            return null;
        }

        final WeakReference<ConstantState> wr = cache.get(key);
        if (wr != null) {
            // We have the key, and the secret
            ConstantState entry = wr.get();
            if (entry != null) {
                return entry.newDrawable(context.getResources());
            } else {
                // Our entry has been purged
                cache.delete(key);
            }
        }
    }
    return null;
}
 
開發者ID:ximsfei,項目名稱:Android-skin-support,代碼行數:23,代碼來源:SkinCompatDrawableManager.java

示例3: checkForContactChange

import android.support.v4.util.LongSparseArray; //導入方法依賴的package包/類
private boolean checkForContactChange(LongSparseArray<DbContactSensor> map, DbContactSensor newItem) {

        long id = newItem.getContactId();
        DbContactSensor existingReminder = map.get(id);

        boolean result = false;

        DbContactSensor existingItem = map.get(id);
        map.delete(id);

        if (existingItem == null) {

            newItem.setIsNew(Boolean.TRUE);
            newItem.setIsUpdated(Boolean.TRUE);
            newItem.setIsDeleted(Boolean.FALSE);

            result = true;

        } else {
            if (hasContactDifference(existingItem, newItem)) {

                newItem.setIsNew(Boolean.FALSE);
                newItem.setIsUpdated(Boolean.TRUE);
                newItem.setIsDeleted(Boolean.FALSE);
                newItem.setId(existingItem.getId());

                result = true;
            }
        }

        if (!result) {
            newItem.setId(existingReminder.getId());
        }

        return result;
    }
 
開發者ID:Telecooperation,項目名稱:assistance-platform-client-sdk-android,代碼行數:37,代碼來源:ContactsSensor.java

示例4: checkForChange

import android.support.v4.util.LongSparseArray; //導入方法依賴的package包/類
private boolean checkForChange(LongSparseArray<DbCalendarSensor> map, DbCalendarSensor newItem) {

        Long eventId = newItem.getEventId();

        if (eventId == null) {
            return false;
        }

        DbCalendarSensor existingItem = map.get(eventId);
        map.delete(eventId);

        if (existingItem == null) {

            newItem.setIsNew(Boolean.TRUE);
            newItem.setIsUpdated(Boolean.TRUE);
            newItem.setIsDeleted(Boolean.FALSE);

            return true;

        }
        if (hasEventDifference(existingItem, newItem)) {

            newItem.setIsNew(Boolean.FALSE);
            newItem.setIsUpdated(Boolean.TRUE);
            newItem.setIsDeleted(Boolean.FALSE);
            newItem.setId(existingItem.getId());

            return true;
        }

        return false;
    }
 
開發者ID:Telecooperation,項目名稱:assistance-platform-client-sdk-android,代碼行數:33,代碼來源:CalendarSensor.java

示例5: checkForReminderChange

import android.support.v4.util.LongSparseArray; //導入方法依賴的package包/類
private boolean checkForReminderChange(LongSparseArray<DbCalendarReminderSensor> map, DbCalendarReminderSensor newItem) {

        if (newItem == null) {
            throw new IllegalArgumentException();
        }

        Long eventId = newItem.getEventId();

        if (eventId == null) {
            return false;
        }

        DbCalendarReminderSensor existingItem = map.get(eventId);
        map.delete(eventId);

        if (existingItem == null) {

            newItem.setIsNew(Boolean.TRUE);
            newItem.setIsUpdated(Boolean.TRUE);
            newItem.setIsDeleted(Boolean.FALSE);

            return true;

        }
        if (hasReminderDifference(existingItem, newItem)) {

            newItem.setIsNew(Boolean.FALSE);
            newItem.setIsUpdated(Boolean.TRUE);
            newItem.setIsDeleted(Boolean.FALSE);
            newItem.setId(existingItem.getId());

            return true;
        }

        return false;
    }
 
開發者ID:Telecooperation,項目名稱:assistance-platform-client-sdk-android,代碼行數:37,代碼來源:CalendarSensor.java

示例6: getCachedDrawable

import android.support.v4.util.LongSparseArray; //導入方法依賴的package包/類
private Drawable getCachedDrawable(LongSparseArray<WeakReference<Drawable.ConstantState>> cache, long key) {
    synchronized (mAccessLock) {
        WeakReference<Drawable.ConstantState> wr = cache.get(key);
        if (wr != null) {
            Drawable.ConstantState entry = wr.get();
            if (entry != null) {
                return entry.newDrawable(this);
            } else {
                cache.delete(key);
            }
        }
    }
    return null;
}
 
開發者ID:ZieIony,項目名稱:Carbon,代碼行數:15,代碼來源:CarbonResources.java

示例7: getCachedDrawable

import android.support.v4.util.LongSparseArray; //導入方法依賴的package包/類
private static Drawable getCachedDrawable(LongSparseArray<WeakReference<Drawable.ConstantState>> cache,
                                          long key, Resources res) {
    synchronized (mAccessLock) {
        WeakReference<Drawable.ConstantState> wr = cache.get(key);
        if (wr != null) {
            Drawable.ConstantState entry = wr.get();
            if (entry != null) {
                return entry.newDrawable(res);
            } else {
                cache.delete(key);
            }
        }
    }
    return null;
}
 
開發者ID:ZieIony,項目名稱:Carbon,代碼行數:16,代碼來源:LollipopDrawablesCompat.java


注:本文中的android.support.v4.util.LongSparseArray.delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。