本文整理汇总了Java中java.util.NavigableSet.addAll方法的典型用法代码示例。如果您正苦于以下问题:Java NavigableSet.addAll方法的具体用法?Java NavigableSet.addAll怎么用?Java NavigableSet.addAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.NavigableSet
的用法示例。
在下文中一共展示了NavigableSet.addAll方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHistogramBuckets
import java.util.NavigableSet; //导入方法依赖的package包/类
public NavigableSet<Long> getHistogramBuckets(boolean supportsAggregablePercentiles) {
NavigableSet<Long> buckets = new TreeSet<>();
if(percentileHistogram && supportsAggregablePercentiles) {
buckets.addAll(PercentileHistogramBuckets.buckets(this));
buckets.add(minimumExpectedValue);
buckets.add(maximumExpectedValue);
}
for (long slaBoundary : sla) {
buckets.add(slaBoundary);
}
return buckets;
}
示例2: getWritableNodes
import java.util.NavigableSet; //导入方法依赖的package包/类
public NavigableSet<PhysicalNode<?,?,?>> getWritableNodes(){
NavigableSet<PhysicalNode<?,?,?>> writableNodes = new TreeSet<>();
for(Router router : routers){
for(ClientId clientId : router.getClientIds()){
if(!clientId.getWritable()){
continue;
}
writableNodes.addAll(getNodes().getPhysicalNodesForClient(clientId.getName()));
}
}
return writableNodes;
}
示例3: testAddAll1
import java.util.NavigableSet; //导入方法依赖的package包/类
/**
* addAll(null) throws NPE
*/
public void testAddAll1() {
NavigableSet q = set0();
try {
q.addAll(null);
shouldThrow();
} catch (NullPointerException success) {}
}
示例4: testAddAll2
import java.util.NavigableSet; //导入方法依赖的package包/类
/**
* addAll of a collection with null elements throws NPE
*/
public void testAddAll2() {
NavigableSet q = set0();
Integer[] ints = new Integer[SIZE];
try {
q.addAll(Arrays.asList(ints));
shouldThrow();
} catch (NullPointerException success) {}
}
示例5: testAddAll3
import java.util.NavigableSet; //导入方法依赖的package包/类
/**
* addAll of a collection with any null elements throws NPE after
* possibly adding some elements
*/
public void testAddAll3() {
NavigableSet q = set0();
Integer[] ints = new Integer[SIZE];
for (int i = 0; i < SIZE - 1; ++i)
ints[i] = new Integer(i + SIZE);
try {
q.addAll(Arrays.asList(ints));
shouldThrow();
} catch (NullPointerException success) {}
}
示例6: testDescendingAddAll1
import java.util.NavigableSet; //导入方法依赖的package包/类
/**
* addAll(null) throws NPE
*/
public void testDescendingAddAll1() {
NavigableSet q = dset0();
try {
q.addAll(null);
shouldThrow();
} catch (NullPointerException success) {}
}
示例7: testDescendingAddAll2
import java.util.NavigableSet; //导入方法依赖的package包/类
/**
* addAll of a collection with null elements throws NPE
*/
public void testDescendingAddAll2() {
NavigableSet q = dset0();
Integer[] ints = new Integer[SIZE];
try {
q.addAll(Arrays.asList(ints));
shouldThrow();
} catch (NullPointerException success) {}
}
示例8: testDescendingAddAll3
import java.util.NavigableSet; //导入方法依赖的package包/类
/**
* addAll of a collection with any null elements throws NPE after
* possibly adding some elements
*/
public void testDescendingAddAll3() {
NavigableSet q = dset0();
Integer[] ints = new Integer[SIZE];
for (int i = 0; i < SIZE - 1; ++i)
ints[i] = new Integer(i + SIZE);
try {
q.addAll(Arrays.asList(ints));
shouldThrow();
} catch (NullPointerException success) {}
}
示例9: getTopHostsWithWeights
import java.util.NavigableSet; //导入方法依赖的package包/类
/**
* return the sorted list of hosts in terms of their weights
*/
public HostAndWeight[] getTopHostsWithWeights() {
NavigableSet<HostAndWeight> orderedHosts = new TreeSet<HostAndWeight>(
new HostAndWeight.WeightComparator());
orderedHosts.addAll(this.hostAndWeights.values());
return orderedHosts.descendingSet().toArray(new HostAndWeight[orderedHosts.size()]);
}
示例10: buildDtoChanges
import java.util.NavigableSet; //导入方法依赖的package包/类
public DtoChanges buildDtoChanges(
final TransactionId.W lowerTxid,
final boolean lowerInclusive,
final TransactionId.W upperTxid,
final boolean upperInclusive)
{
final Set<AbstractModel> newMvos = new HashSet<AbstractModel>();
final Set<AbstractModel> changedMvos = new HashSet<AbstractModel>();
for (AbstractModel obj : getAbstractModels()) {
final TransactionId.W initialTxid = obj.getInitialVersion();
if (lowerTxid.serial <= initialTxid.serial && initialTxid.serial <= upperTxid.serial) {
newMvos.add(obj);
}
NavigableSet<TransactionId.W> txids = new TreeSet<TransactionId.W>();
txids.addAll(getTransactionIds(obj));
for (String attrname : obj.getAttributeNames()) {
final Object value = obj.getValue(attrname);
if (value instanceof Attribute.SetAttr<?, ?>) {
final MvoSet<?> mvoset = ((Attribute.SetAttr<?, AbstractModel>) value).get(obj);
txids.addAll(getTransactionIds(mvoset));
}
if (value instanceof Attribute.ListAttr<?, ?>) {
final MvoList<?> mvolist = ((Attribute.ListAttr<?, AbstractModel>) value).get(obj);
txids.addAll(getTransactionIds(mvolist));
}
if (value instanceof Attribute.MapAttr<?, ?, ?>) {
final MvoMap<?, ?> mvomap = ((Attribute.MapAttr<?, ?, AbstractModel>) value).get(obj);
txids.addAll(getTransactionIds(mvomap));
}
}
txids = txids.subSet(lowerTxid, lowerInclusive, upperTxid, upperInclusive);
if (0 < txids.size()) {
changedMvos.add(obj);
}
}
changedMvos.removeAll(newMvos);
return new DtoChanges(
originator_, lowerTxid, upperTxid, TransactionContext.getTargetTime(),
buildDtos(newMvos), buildDtos(changedMvos));
}