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

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

本文整理了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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

相关文章