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


Java VolleyLog.DEBUG屬性代碼示例

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


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

示例1: pruneIfNeeded

/**
 * Prunes the cache to fit the amount of bytes specified.
 * @param neededSpace The amount of bytes we are trying to fit into the cache.
 */
private void pruneIfNeeded(int neededSpace) {
    if ((mTotalSize + neededSpace) < mMaxCacheSizeInBytes) {
        return;
    }
    if (VolleyLog.DEBUG) {
        VolleyLog.v("Pruning old cache entries.");
    }

    long before = mTotalSize;
    int prunedFiles = 0;
    long startTime = SystemClock.elapsedRealtime();

    Iterator<Map.Entry<String, CacheHeader>> iterator = mEntries.entrySet().iterator();
    while (iterator.hasNext()) {
        Map.Entry<String, CacheHeader> entry = iterator.next();
        CacheHeader e = entry.getValue();
        boolean deleted = getFileForKey(e.key).delete();
        if (deleted) {
            mTotalSize -= e.size;
        } else {
           VolleyLog.d("Could not delete cache entry for key=%s, filename=%s",
                   e.key, getFilenameForKey(e.key));
        }
        iterator.remove();
        prunedFiles++;

        if ((mTotalSize + neededSpace) < mMaxCacheSizeInBytes * HYSTERESIS_FACTOR) {
            break;
        }
    }

    if (VolleyLog.DEBUG) {
        VolleyLog.v("pruned %d files, %d bytes, %d ms",
                prunedFiles, (mTotalSize - before), SystemClock.elapsedRealtime() - startTime);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:40,代碼來源:DiskBasedCache.java

示例2: init

public static void init(EaseConfig easeConfig) {
    mInstance = mInstance == null ? mInstance = easeConfig : mInstance;

    if (mInstance.enableLogging()) {
        VolleyLog.DEBUG = true;
        VolleyLog.TAG = "ease";
    }
}
 
開發者ID:allaudin,項目名稱:ease-volley-wrapper,代碼行數:8,代碼來源:EaseUtils.java

示例3: pruneIfNeeded

private void pruneIfNeeded(int neededSpace) {
    if (this.mTotalSize + ((long) neededSpace) >= ((long) this.mMaxCacheSizeInBytes)) {
        if (VolleyLog.DEBUG) {
            VolleyLog.v("Pruning old cache entries.", new Object[0]);
        }
        long before = this.mTotalSize;
        int prunedFiles = 0;
        long startTime = SystemClock.elapsedRealtime();
        Iterator<Map.Entry<String, CacheHeader>> iterator = this.mEntries.entrySet().iterator();
        while (iterator.hasNext()) {
            CacheHeader e = (CacheHeader) ((Map.Entry) iterator.next()).getValue();
            if (getFileForKey(e.key).delete()) {
                this.mTotalSize -= e.size;
            } else {
                VolleyLog.d("Could not delete cache entry for key=%s, filename=%s", e.key, getFilenameForKey(e.key));
            }
            iterator.remove();
            prunedFiles++;
            if (((float) (this.mTotalSize + ((long) neededSpace))) < ((float) this.mMaxCacheSizeInBytes) * HYSTERESIS_FACTOR) {
                break;
            }
        }
        if (VolleyLog.DEBUG) {
            VolleyLog.v("pruned %d files, %d bytes, %d ms", Integer.valueOf(prunedFiles), Long.valueOf(this.mTotalSize - before), Long.valueOf(SystemClock.elapsedRealtime() - startTime));
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:27,代碼來源:DiskBasedCache.java

示例4: pruneIfNeeded

/**
 * Prunes the cache to fit the amount of bytes specified.
 * @param neededSpace The amount of bytes we are trying to fit into the cache.
 */
private void pruneIfNeeded(int neededSpace) {
  if ((mTotalSize + neededSpace) < mMaxCacheSizeInBytes) {
    return;
  }
  if (VolleyLog.DEBUG) {
    VolleyLog.v("Pruning old cache entries.");
  }

  long before = mTotalSize;
  int prunedFiles = 0;
  long startTime = SystemClock.elapsedRealtime();

  Iterator<Map.Entry<String, CacheHeader>> iterator = mEntries.entrySet().iterator();
  while (iterator.hasNext()) {
    Map.Entry<String, CacheHeader> entry = iterator.next();
    CacheHeader e = entry.getValue();
    boolean deleted = getFileForKey(e.key).delete();
    if (deleted) {
      mTotalSize -= e.size;
    } else {
      VolleyLog.d("Could not delete cache entry for key=%s, filename=%s",
          e.key, getFilenameForKey(e.key));
    }
    iterator.remove();
    prunedFiles++;

    if ((mTotalSize + neededSpace) < mMaxCacheSizeInBytes * HYSTERESIS_FACTOR) {
      break;
    }
  }

  if (VolleyLog.DEBUG) {
    VolleyLog.v("pruned %d files, %d bytes, %d ms",
        prunedFiles, (mTotalSize - before), SystemClock.elapsedRealtime() - startTime);
  }
}
 
開發者ID:nordfalk,項目名稱:EsperantoRadio,代碼行數:40,代碼來源:DrDiskBasedCache.java


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