本文整理了Java中java.util.AbstractSet.addAll()
方法的一些代码示例,展示了AbstractSet.addAll()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractSet.addAll()
方法的具体详情如下:
包路径:java.util.AbstractSet
类名称:AbstractSet
方法名:addAll
暂无
代码示例来源:origin: robovm/robovm
public boolean addAll(Collection<? extends T> c) {
return adapter.addAll(c);
}
public void clear() {
代码示例来源:origin: robovm/robovm
public boolean addAll(Collection<? extends T> c) {
return adapter.addAll(c);
}
public void clear() {
代码示例来源:origin: robovm/robovm
/**
* Adds the objects in the specified collection to this {@code TreeSet}.
*
* @param collection
* the collection of objects to add.
* @return {@code true} if this {@code TreeSet} was modified, {@code false}
* otherwise.
* @throws ClassCastException
* when an object in the collection cannot be compared with the
* elements in this {@code TreeSet}.
* @throws NullPointerException
* when an object in the collection is null and the comparator
* cannot handle null.
*/
@Override
public boolean addAll(Collection<? extends E> collection) {
return super.addAll(collection);
}
代码示例来源:origin: Sable/soot
@SuppressWarnings("unchecked")
final public boolean addAll(Collection<? extends E> s) {
boolean ret = false;
if (!(s instanceof ArraySet)) {
return super.addAll(s);
}
ArraySet<?> as = (ArraySet<?>) s;
int asSize = as.size();
Object[] asElements = as.elements;
for (int i = 0; i < asSize; i++) {
ret = add((E) asElements[i]) | ret;
}
return ret;
}
代码示例来源:origin: geotools/geotools
/**
* Adds all of the elements in the specified collection to this set. All of the elements will be
* removed from mutually exclusive sets.
*
* @param c collection whose elements are to be added to this set.
* @return {@code true} if this set changed as a result of the call.
*/
@Override
public boolean addAll(final Collection<? extends E> c) {
synchronized (map) {
return super.addAll(c);
}
}
代码示例来源:origin: org.geotools/gt2-metadata
/**
* Adds all of the elements in the specified collection to this collection.
*/
public boolean addAll(final Collection/*<? extends E>*/ collection) {
synchronized (hash) {
return super.addAll(collection);
}
}
代码示例来源:origin: blazegraph/database
/**
* @todo override with implementation using chunked ordered writes.
*/
public boolean addAll(Collection<? extends E> c) {
return super.addAll(c);
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-security-api
@Override
public boolean addAll(Collection<? extends Right> rights)
{
if (!(rights instanceof RightSet)) {
return super.addAll(rights);
}
long old = this.rights;
this.rights |= ((RightSet) rights).rights;
return this.rights != old;
}
代码示例来源:origin: ibinti/bugvm
public boolean addAll(Collection<? extends T> c) {
return adapter.addAll(c);
}
public void clear() {
代码示例来源:origin: ibinti/bugvm
public boolean addAll(Collection<? extends T> c) {
return adapter.addAll(c);
}
public void clear() {
代码示例来源:origin: org.clulab/processors
public HashSet(Collection<? extends E> c) {
int newCapacity = INITIAL_TABLE_SIZE;
int expectedSize = c.size();
while (newCapacity * 3 < expectedSize * 4) {
newCapacity <<= 1;
}
table = new Object[newCapacity];
super.addAll(c);
}
代码示例来源:origin: org.maltparser/maltparser
public HashSet(Collection<? extends E> c) {
int newCapacity = INITIAL_TABLE_SIZE;
int expectedSize = c.size();
while (newCapacity * 3 < expectedSize * 4) {
newCapacity <<= 1;
}
table = new Object[newCapacity];
super.addAll(c);
}
代码示例来源:origin: net.sourceforge.ondex.core/base
@SuppressWarnings("rawtypes")
@Override
public boolean addAll(Collection<? extends AnyType> c) {
if (c instanceof ONDEXSet) {
int size = set.cardinality();
set.or(((ONDEXSet) c).set);
return size != set.cardinality();
} else {
return super.addAll(c);
}
}
代码示例来源:origin: org.maltparser/maltparser
@Override
public boolean addAll(Collection<? extends E> c) {
ensureSizeFor(size + c.size());
return super.addAll(c);
}
代码示例来源:origin: com.bugvm/bugvm-soot
@SuppressWarnings("unchecked")
final public boolean addAll(Collection<? extends E> s) {
boolean ret = false;
if( !(s instanceof ArraySet) ) return super.addAll(s);
ArraySet as = (ArraySet) s;
int asSize = as.size();
Object[] asElements = as.elements;
for (int i=0; i<asSize; i++)
ret = add( (E)asElements[i] ) | ret;
return ret;
}
代码示例来源:origin: ibinti/bugvm
@SuppressWarnings("unchecked")
final public boolean addAll(Collection<? extends E> s) {
boolean ret = false;
if( !(s instanceof ArraySet) ) return super.addAll(s);
ArraySet as = (ArraySet) s;
int asSize = as.size();
Object[] asElements = as.elements;
for (int i=0; i<asSize; i++)
ret = add( (E)asElements[i] ) | ret;
return ret;
}
代码示例来源:origin: backport-util-concurrent/backport-util-concurrent
public boolean addAll(Collection c) {
if (map.size() == 0 && c.size() > 0 &&
c instanceof SortedSet && map instanceof TreeMap &&
eq(((SortedSet)c).comparator(), this.comparator()))
{
((TreeMap)map).buildFromSorted(new MapIterator(c.iterator()), c.size());
return true;
}
else {
return super.addAll(c);
}
}
代码示例来源:origin: edu.emory.mathcs.backport/com.springsource.edu.emory.mathcs.backport
public boolean addAll(Collection c) {
if (map.size() == 0 && c.size() > 0 &&
c instanceof SortedSet && map instanceof TreeMap &&
eq(((SortedSet)c).comparator(), this.comparator()))
{
((TreeMap)map).buildFromSorted(new MapIterator(c.iterator()), c.size());
return true;
}
else {
return super.addAll(c);
}
}
代码示例来源:origin: backport-util-concurrent/backport-util-concurrent-java12
public boolean addAll(Collection c) {
if (map.size() == 0 && c.size() > 0 &&
c instanceof SortedSet && map instanceof TreeMap &&
eq(((SortedSet)c).comparator(), this.comparator()))
{
((TreeMap)map).buildFromSorted(new MapIterator(c.iterator()), c.size());
return true;
}
else {
return super.addAll(c);
}
}
代码示例来源:origin: boundary/high-scale-lib
@Override
public boolean addAll(Collection<? extends Long> c) {
if (!NonBlockingHashSetLong.class.equals(c.getClass())) {
return super.addAll(c);
}
boolean modified = false;
for (final LongIterator it = ((NonBlockingHashSetLong)c).longIterator(); it.hasNext(); ) {
modified |= add(it.nextLong());
}
return modified;
}
内容来源于网络,如有侵权,请联系作者删除!