本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}