org.openide.util.WeakSet.addAll()方法的使用及代码示例

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

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

WeakSet.addAll介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-util

/**
 * Constructs a new <tt>WeakSet</tt> with the same mappings as the
 * specified map.  The <tt>WeakSet</tt> is created with the default
 * load factor (0.75) and an initial capacity sufficient to hold the
 * mappings in the specified map.
 *
 * @param   s the map whose mappings are to be placed in this map
 * @throws  NullPointerException if the specified map is null
 */
public WeakSet(Collection<? extends E> s) {
  this(Math.max((int) (s.size() / SharedKeyWeakHashMap.DEFAULT_LOAD_FACTOR) + 1, 16),
      SharedKeyWeakHashMap.DEFAULT_LOAD_FACTOR);
  addAll(s);
}

代码示例来源:origin: org.netbeans.api/org-openide-util

@Override
public Object clone() {      
  try {
    WeakSet<E> nws = (WeakSet<E>) super.clone();
    // sharing load factor is ok
    // but we can not share maps, recreate them
    nws.m = new SharedKeyWeakHashMap<E, Boolean>(size(), loadFactor);
    nws.s = nws.m.keySet();
    nws.addAll(this);
    return nws;
  } catch (CloneNotSupportedException e) {
    throw new IllegalStateException("base class doesn't support clone", e); // NOI18N
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** Constructs a new set containing the elements in the specified collection.
* @param c a collection to add
*/
public WeakSet(Collection c) {
  this ();
  addAll(c);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** Constructs a new set containing the elements in the specified collection.
* @param c a collection to add
*/
public WeakSet(Collection c) {
  this ();
  addAll(c);
}

代码示例来源:origin: in.jlibs/org-openide-util

/** Constructs a new set containing the elements in the specified collection.
* @param c a collection to add
*/
public WeakSet(Collection<? extends E> c) {
  this();
  addAll(c);
}

代码示例来源:origin: senbox-org/snap-desktop

public CloseProductAction(List<Product> products) {
  productSet.addAll(products);
}

代码示例来源:origin: uk.gov.nationalarchives.thirdparty.netbeans/org-openide-util

/**
 * Constructs a new <tt>WeakSet</tt> with the same mappings as the
 * specified map.  The <tt>WeakSet</tt> is created with the default
 * load factor (0.75) and an initial capacity sufficient to hold the
 * mappings in the specified map.
 *
 * @param   s the map whose mappings are to be placed in this map
 * @throws  NullPointerException if the specified map is null
 */
public WeakSet(Collection<? extends E> s) {
  this(Math.max((int) (s.size() / SharedKeyWeakHashMap.DEFAULT_LOAD_FACTOR) + 1, 16),
      SharedKeyWeakHashMap.DEFAULT_LOAD_FACTOR);
  addAll(s);
}

代码示例来源:origin: uk.gov.nationalarchives.thirdparty.netbeans/org-openide-util

@Override
public Object clone() {      
  try {
    WeakSet<E> nws = (WeakSet<E>) super.clone();
    // sharing load factor is ok
    // but we can not share maps, recreate them
    nws.m = new SharedKeyWeakHashMap<E, Boolean>(size(), loadFactor);
    nws.s = nws.m.keySet();
    nws.addAll(this);
    return nws;
  } catch (CloneNotSupportedException e) {
    throw new IllegalStateException("base class doesn't support clone", e); // NOI18N
  }
}

相关文章