當前位置: 首頁>>代碼示例>>Java>>正文


Java Collections.unmodifiableCollection方法代碼示例

本文整理匯總了Java中java.util.Collections.unmodifiableCollection方法的典型用法代碼示例。如果您正苦於以下問題:Java Collections.unmodifiableCollection方法的具體用法?Java Collections.unmodifiableCollection怎麽用?Java Collections.unmodifiableCollection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.util.Collections的用法示例。


在下文中一共展示了Collections.unmodifiableCollection方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getTransactions

import java.util.Collections; //導入方法依賴的package包/類
@ApiModelProperty(
        access = "public",
        name = "transactions",
        value = "the transactions that have taken place for the account.")
public Collection<TransactionRepresentation> getTransactions() {
    if (transactions == null) {
        return null;
    } else {
        return Collections.unmodifiableCollection(transactions);
    }
}
 
開發者ID:psd2-in-a-box,項目名稱:mid-tier,代碼行數:12,代碼來源:AccountRepresentation.java

示例2: listNetworkInterfaceIPConfigurations

import java.util.Collections; //導入方法依賴的package包/類
@Override
public Collection<NicIPConfiguration> listNetworkInterfaceIPConfigurations() {
    Collection<NicIPConfiguration> ipConfigs = new ArrayList<>();
    Map<String, NetworkInterface> nics = new TreeMap<>();
    List<IPConfigurationInner> ipConfigRefs = this.inner().ipConfigurations();
    if (ipConfigRefs == null) {
        return ipConfigs;
    }

    for (IPConfigurationInner ipConfigRef : ipConfigRefs) {
        String nicID = ResourceUtils.parentResourceIdFromResourceId(ipConfigRef.id());
        String ipConfigName = ResourceUtils.nameFromResourceId(ipConfigRef.id());
        // Check if NIC already cached
        NetworkInterface nic = nics.get(nicID.toLowerCase());
        if (nic == null) {
            //  NIC not previously found, so ask Azure for it
            nic = this.parent().manager().networkInterfaces().getById(nicID);
        }

        if (nic == null) {
            // NIC doesn't exist so ignore this bad reference
            continue;
        }

        // Cache the NIC
        nics.put(nic.id().toLowerCase(), nic);

        // Get the IP config
        NicIPConfiguration ipConfig = nic.ipConfigurations().get(ipConfigName);
        if (ipConfig == null) {
            // IP config not found, so ignore this bad reference
            continue;
        }

        ipConfigs.add(ipConfig);
    }

    return Collections.unmodifiableCollection(ipConfigs);
}
 
開發者ID:Azure,項目名稱:azure-libraries-for-java,代碼行數:40,代碼來源:SubnetImpl.java

示例3: getCurrentSourceRootsForClasspath

import java.util.Collections; //導入方法依賴的package包/類
/**
 * Finds source roots corresponding to the apparently active classpath
 * (as reported by logging from Ant when it runs the Java launcher with -cp).
 */
private static Collection<FileObject> getCurrentSourceRootsForClasspath(SessionData data) {
    if (data.classpath == null &&
            data.modulepath == null &&
            data.upgradeModulepath == null) {
        return Collections.emptySet();
    }
    Collection<FileObject> result;
    synchronized (data) {
        result = data.searchSourceRoots;
    }
    if (result == null) {
        result = new LinkedHashSet<>();
        addPath(data.classpath, result, false);
        addPath(data.modulepath, result, true);
        addPath(data.upgradeModulepath, result, true);
        if (data.platformSources != null) {
            result.addAll(Arrays.asList(data.platformSources.getRoots()));
        } else {
            // no platform found. use default one:
            JavaPlatform plat = JavaPlatform.getDefault();
            // in unit tests the default platform may be null:
            if (plat != null) {
                result.addAll(Arrays.asList(plat.getSourceFolders().getRoots()));
            }
        }
        result = Collections.unmodifiableCollection(result);
        synchronized (data) {
            data.searchSourceRoots = result;
        }
    }
    return result;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:37,代碼來源:JavaAntLogger.java

示例4: jsonNodeToAllocationPools

import java.util.Collections; //導入方法依賴的package包/類
/**
 * Changes JsonNode alocPools to a collection of the alocPools.
 *
 * @param allocationPools the allocationPools JsonNode
 * @return a collection of allocationPools
 */
public Iterable<AllocationPool> jsonNodeToAllocationPools(JsonNode allocationPools) {
    checkNotNull(allocationPools, JSON_NOT_NULL);
    ConcurrentMap<Integer, AllocationPool> alocplMaps = Maps
            .newConcurrentMap();
    Integer i = 0;
    for (JsonNode node : allocationPools) {
        IpAddress startIp = IpAddress.valueOf(node.get("start").asText());
        IpAddress endIp = IpAddress.valueOf(node.get("end").asText());
        AllocationPool alocPls = new DefaultAllocationPool(startIp, endIp);
        alocplMaps.putIfAbsent(i, alocPls);
        i++;
    }
    return Collections.unmodifiableCollection(alocplMaps.values());
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:21,代碼來源:SubnetWebResource.java

示例5: getMethodNames

import java.util.Collections; //導入方法依賴的package包/類
@Override
@NonNull
public Collection<? extends String> getMethodNames(
        final @NonNull String clz,
        final boolean rt,
        final @NullAllowed String returnType,
        final @NullAllowed String... parameterTypes) throws QueryException {
    final List<? extends ExecutableElement> methods = getMethods(clz, null, rt, returnType, parameterTypes);
    final List<String> result = new ArrayList<String>(methods.size());
    for (ExecutableElement method : methods) {
        result.add(method.getSimpleName().toString());
    }
    return Collections.unmodifiableCollection(result);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:15,代碼來源:JavaOperationsImpl.java

示例6: getSubnets

import java.util.Collections; //導入方法依賴的package包/類
@Override
public Iterable<Subnet> getSubnets() {
    return Collections.unmodifiableCollection(subnetStore.values());
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:5,代碼來源:SubnetManager.java

示例7: getPropertyKeys

import java.util.Collections; //導入方法依賴的package包/類
public Collection<String> getPropertyKeys() {
	return Collections.unmodifiableCollection(properties.keySet());
}
 
開發者ID:Bibliome,項目名稱:alvisnlp,代碼行數:4,代碼來源:Run.java

示例8: getTextBound

import java.util.Collections; //導入方法依賴的package包/類
public Collection<TextBound> getTextBound() {
	return Collections.unmodifiableCollection(textBound);
}
 
開發者ID:Bibliome,項目名稱:bibliome-java-utils,代碼行數:4,代碼來源:AlvisAEAnnotationSet.java

示例9: getProperties

import java.util.Collections; //導入方法依賴的package包/類
public synchronized Collection<Property> getProperties() {
    Property[] properties = getSheet().get(Sheet.PROPERTIES).getProperties();
    return Collections.unmodifiableCollection(Arrays.asList(properties));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:5,代碼來源:BaseNode.java

示例10: getAnnotationSchemas

import java.util.Collections; //導入方法依賴的package包/類
public Collection<AnnotationSchema> getAnnotationSchemas() {
	return Collections.unmodifiableCollection(annotationSchemas.values());
}
 
開發者ID:Bibliome,項目名稱:bibliome-java-utils,代碼行數:4,代碼來源:DocumentSchema.java

示例11: getViolations

import java.util.Collections; //導入方法依賴的package包/類
Collection<Violation> getViolations() {
    return Collections.unmodifiableCollection(violations);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:4,代碼來源:ProfileSupport.java

示例12: getFloatingIps

import java.util.Collections; //導入方法依賴的package包/類
@Override
public Collection<FloatingIp> getFloatingIps() {
    return Collections.unmodifiableCollection(floatingIpStore.values());
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:5,代碼來源:FloatingIpManager.java

示例13: removeMessages

import java.util.Collections; //導入方法依賴的package包/類
public Collection removeMessages() {
    Collection result = Collections.unmodifiableCollection(messages);
    messages.clear();
    return result;
}
 
開發者ID:yunhaibin,項目名稱:dubbox-hystrix,代碼行數:6,代碼來源:MultiMessage.java

示例14: getSnakes

import java.util.Collections; //導入方法依賴的package包/類
protected static Collection<Snake> getSnakes() {
    return Collections.unmodifiableCollection(snakes.values());
}
 
開發者ID:sunmingshuai,項目名稱:apache-tomcat-7.0.73-with-comment,代碼行數:4,代碼來源:SnakeTimer.java

示例15: getConsumers

import java.util.Collections; //導入方法依賴的package包/類
public final Collection<Consumer<U>> getConsumers() {
    return (Collections.unmodifiableCollection(this.consumers));
}
 
開發者ID:s-store,項目名稱:s-store,代碼行數:4,代碼來源:Producer.java


注:本文中的java.util.Collections.unmodifiableCollection方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。