当前位置: 首页>>代码示例>>Java>>正文


Java NavigableSet.addAll方法代码示例

本文整理汇总了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;
}
 
开发者ID:micrometer-metrics,项目名称:micrometer,代码行数:16,代码来源:HistogramConfig.java

示例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;
}
 
开发者ID:hotpads,项目名称:datarouter,代码行数:13,代码来源:Datarouter.java

示例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) {}
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:TreeSubSetTest.java

示例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) {}
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:TreeSubSetTest.java

示例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) {}
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:TreeSubSetTest.java

示例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) {}
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:TreeSubSetTest.java

示例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) {}
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:TreeSubSetTest.java

示例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) {}
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:TreeSubSetTest.java

示例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()]);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:10,代码来源:HDFSBlocksDistribution.java

示例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));
}
 
开发者ID:openNaEF,项目名称:openNaEF,代码行数:45,代码来源:DtoChangesBuilder.java


注:本文中的java.util.NavigableSet.addAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。