當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。