java.util.WeakHashMap.clear()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(134)

本文整理了Java中java.util.WeakHashMap.clear()方法的一些代码示例,展示了WeakHashMap.clear()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WeakHashMap.clear()方法的具体详情如下:
包路径:java.util.WeakHashMap
类名称:WeakHashMap
方法名:clear

WeakHashMap.clear介绍

[英]Removes all mappings from this map, leaving it empty.
[中]删除此映射中的所有映射,将其保留为空。

代码示例

代码示例来源:origin: jersey/jersey

public void dispose() {
    this.instances.clear();
  }
}

代码示例来源:origin: javax.validation/validation-api

public static synchronized void clearCache() {
  INSTANCE.providersPerClassloader.clear();
}

代码示例来源:origin: robovm/robovm

@Override
public void clear() {
  WeakHashMap.this.clear();
}

代码示例来源:origin: robovm/robovm

@Override
public void clear() {
  WeakHashMap.this.clear();
}

代码示例来源:origin: hawtio/hawtio

public void clearCache() {
  cache.clear();
  packageCache.clear();
  classLoaderProviderMap.clear();
}

代码示例来源:origin: orbit/orbit

public synchronized void clearTimers()
{
  if (timers != null)
  {
    timers.keySet().stream()
        .filter(r -> r != null)
        .forEach(Registration::dispose);
    timers.clear();
    timers = null;
  }
}

代码示例来源:origin: android-hacker/VirtualXposed

public void updateConfiguration(Configuration config) {
  synchronized (this) {
    int changes = mConfiguration.updateFrom(config);
    if ((changes & ~(ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_KEYBOARD_HIDDEN
        | ActivityInfo.CONFIG_ORIENTATION)) != 0) {
      // The configurations being masked out are ones that commonly
      // change so we don't want flushing the cache... all others
      // will flush the cache.
      mPackages.clear();
    }
  }
}

代码示例来源:origin: aa112901/remusic

public static void exitService() {
//        if (mService == null) {
//            return;
//        }
    try {
      mConnectionMap.clear();
      Log.e("exitmp", "Destroying service");
      mService.exit();
    } catch (Exception e) {
    }
  }

代码示例来源:origin: reactor/reactor-core

@Override
  public void dispose() {
    Search.in(globalRegistry)
       .tagKeys(TAG_SCHEDULER_ID)
       .meters()
       .forEach(globalRegistry::remove);

    //note default isDisposed (returning false) is good enough, since the cleared
    //collections can always be reused even though they probably won't
    this.seenSchedulers.clear();
    this.schedulerDifferentiator.clear();
    this.executorDifferentiator.clear();
  }
}

代码示例来源:origin: robovm/robovm

cache.clear();
cacheLocale = defaultLocale;

代码示例来源:origin: pmd/pmd

@Override
public Object visit(ASTUserClass node, Object data) {
  if (Helper.isTestMethodOrClass(node) || Helper.isSystemLevelClass(node)) {
    return data; // stops all the rules
  }
  if (!Helper.isTestMethodOrClass(node)) {
    boolean sharingFound = isSharingPresent(node);
    checkForSharingDeclaration(node, data, sharingFound);
    checkForDatabaseMethods(node, data, sharingFound);
  }
  localCacheOfReportedNodes.clear();
  return data;
}

代码示例来源:origin: xfumihiro/ViewInspector

@Override public void onMeasure(View view, int widthMeasureSpec, int heightMeasureSpec) {
 if (isNotBypassed(view) && isNotFiltered(view)) {
  if (ViewInspector.viewRoot == null && ViewUtil.isLevelTwoView(view)) {
   Log.d(ViewInspector.TAG, "insert ScalpelLayout as a parent of view: " + view);
   insertScalpelLayout(view);
  }
  if (logViewEvents.get()) LogUtil.logOnMeasure(view, widthMeasureSpec, heightMeasureSpec);
  if (probeMeasures.get()) {
   if (ViewUtil.isViewRoot(view)) mMeasureByView.clear();
  }
 }
 super.onMeasure(view, widthMeasureSpec, heightMeasureSpec);
 if (probeMeasures.get() && isNotBypassed(view) && isNotFiltered(view)) {
  if (!(view instanceof ViewGroup)) {
   final Integer measureCount = mMeasureByView.get(view);
   mMeasureByView.put(view, (measureCount != null ? measureCount : 0) + 1);
  }
 }
}

代码示例来源:origin: GeekGhost/Ghost

/**
 * 删除所有Logger持有的对象
 */
public static void removeAllLogger() {
  if (loggerHashMap != null) {
    loggerHashMap.clear();
  }
}

代码示例来源:origin: Vazkii/Botania

/**
 * Clears the cached networks, called once per tick, should not be called outside
 * of the botania code.
 */
public static void clearCache() {
  cachedNetworks.clear();
}

代码示例来源:origin: Vazkii/Botania

@Override
public void clear() {
  manaPools.clear();
  manaCollectors.clear();
}

代码示例来源:origin: parse-community/Parse-SDK-Android

/**
 * Clears all in-memory caches so that data must be retrieved from disk.
 */
void simulateReboot() {
  synchronized (lock) {
    uuidToObjectMap.clear();
    objectToUuidMap.clear();
    classNameAndObjectIdToObjectMap.clear();
    fetchedObjects.clear();
  }
}

代码示例来源:origin: javax.persistence/com.springsource.javax.persistence

/**
 * Clear all cached providers
 */
public void clearCachedProviders() {
  this.providers.clear();
}

代码示例来源:origin: com.orientechnologies/orientdb-core

@Override
 public void clear() {
  cache.clear();
 }
}

代码示例来源:origin: owntracks/android

@Override
public void clearMarkers() {
  if (isMapReady)
    mMap.clear();
  mMarkers.clear();
}

代码示例来源:origin: PhilippC/keepass2android

public void closing() {
  mPreviewPopup.dismiss();
  mHandler.cancelAllMessages();
  dismissPopupKeyboard();
  mBuffer = null;
  mCanvas = null;
  mMiniKeyboardCache.clear();
}

相关文章