Example usage for java.util Collections unmodifiableCollection

List of usage examples for java.util Collections unmodifiableCollection

Introduction

In this page you can find the example usage for java.util Collections unmodifiableCollection.

Prototype

public static <T> Collection<T> unmodifiableCollection(Collection<? extends T> c) 

Source Link

Document

Returns an unmodifiable view of the specified collection.

Usage

From source file:com.github.erchu.beancp.MapperBuilder.java

@Override
public boolean isConverterAvailable(final Class sourceClass, final Class destinationClass) {
    notNull(sourceClass, "sourceClass");
    notNull(destinationClass, "destinationClass");

    return MapperExecutorSelector.isConverterAvailable(this, sourceClass, destinationClass,
            Collections.unmodifiableCollection(_converters));
}

From source file:edu.uci.ics.jung.graph.SparseMultigraph.java

public Collection<V> getSuccessors(V vertex) {
    if (!containsVertex(vertex))
        return null;
    Set<V> succs = new HashSet<V>();
    for (E edge : getOutgoing_internal(vertex)) {
        if (getEdgeType(edge) == EdgeType.DIRECTED) {
            succs.add(this.getDest(edge));
        } else {// w  w  w.jav a 2  s.c o  m
            succs.add(getOpposite(vertex, edge));
        }
    }
    return Collections.unmodifiableCollection(succs);
}

From source file:fr.gouv.culture.thesaurus.service.rdf.Concept.java

public Collection<Concept> getParentConcepts() {
    return Collections.unmodifiableCollection(this.parentConcepts);
}

From source file:net.wouterdanes.docker.maven.AbstractDockerMojo.java

protected Collection<BuiltImageInfo> getBuiltImages() {
    Map<String, BuiltImageInfo> builtImagesMap = obtainMapFromPluginContext(BUILT_IMAGES_KEY);
    return Collections.unmodifiableCollection(builtImagesMap.values());
}

From source file:com.smartitengineering.events.async.api.impl.hub.EventSubscriberImpl.java

@Override
public Collection<EventConsumer> getConsumers() {
    return Collections.unmodifiableCollection(consumers);
}

From source file:de.btobastian.javacord.entities.message.impl.ImplMessageHistory.java

@Override
public Collection<Message> getMessages() {
    return Collections.unmodifiableCollection(messages.values());
}

From source file:com.opengamma.engine.view.compilation.CompiledViewCalculationConfigurationImpl.java

private static Map<ValueSpecification, Collection<ValueSpecification>> processMarketDataRequirements(
        final DependencyGraph dependencyGraph) {
    ArgumentChecker.notNull(dependencyGraph, "dependencyGraph");
    final Collection<ValueSpecification> marketDataEntries = dependencyGraph.getAllRequiredMarketData();
    final Map<ValueSpecification, Collection<ValueSpecification>> result = Maps
            .newHashMapWithExpectedSize(marketDataEntries.size());
    final Set<ValueSpecification> terminalOutputs = dependencyGraph.getTerminalOutputSpecifications();
    for (ValueSpecification marketData : marketDataEntries) {
        final DependencyNode marketDataNode = dependencyGraph.getNodeProducing(marketData);
        Collection<ValueSpecification> aliases = null;
        Collection<DependencyNode> aliasNodes = marketDataNode.getDependentNodes();
        boolean usedDirectly = terminalOutputs.contains(marketData);
        for (DependencyNode aliasNode : aliasNodes) {
            if (aliasNode.getFunction().getFunction() instanceof MarketDataAliasingFunction) {
                if (aliases == null) {
                    aliases = new ArrayList<>(aliasNodes.size());
                    result.put(marketData, Collections.unmodifiableCollection(aliases));
                }//from  w  w  w. j  av a2 s.  c  o m
                aliases.addAll(aliasNode.getOutputValues());
            } else {
                usedDirectly = true;
            }
        }
        if (usedDirectly) {
            if (aliases != null) {
                aliases.add(marketData);
            } else {
                result.put(marketData, Collections.singleton(marketData));
            }
        }
    }
    return Collections.unmodifiableMap(result);
}

From source file:edu.uci.ics.jung.graph.DirectedSparseGraph.java

public Collection<E> getIncidentEdges(V vertex) {
    if (!containsVertex(vertex))
        return null;

    Collection<E> incident_edges = new HashSet<E>();
    incident_edges.addAll(getIncoming_internal(vertex));
    incident_edges.addAll(getOutgoing_internal(vertex));
    return Collections.unmodifiableCollection(incident_edges);
}

From source file:net.tawacentral.roger.secrets.OnlineAgentManager.java

/**
 * Get available agents/*from www. ja va2s.  c  o  m*/
 * 
 * @return collection of installed agents
 */
public static Collection<OnlineSyncAgent> getAvailableAgents() {
    return Collections.unmodifiableCollection(AVAILABLE_AGENTS.values());
}

From source file:org.terasoluna.gfw.web.codelist.CodeListInterceptor.java

/**
 * Extracts the {@code CodeList}s which are to be set to the attribute of {@link HttpServletRequest}
 * <p>/*  w w w  . ja va2  s . com*/
 * Among the Beans which implement {@code CodeList} interface, extract the Codelist IDs(Bean IDs) which match<br>
 * with the regular expression specified in {@link #codeListIdPattern}.
 * </p>
 * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
 */
@Override
public void afterPropertiesSet() {

    Assert.notNull(applicationContext, "applicationContext is null.");

    if (codeListIdPattern == null) {
        this.codeListIdPattern = Pattern.compile(".+");
    }

    Map<String, CodeList> definedCodeLists = BeanFactoryUtils.beansOfTypeIncludingAncestors(applicationContext,
            CodeList.class, false, false);
    Map<String, CodeList> targetCodeLists = new HashMap<String, CodeList>();
    for (CodeList codeList : definedCodeLists.values()) {
        String codeListId = codeList.getCodeListId();
        if (codeListId != null) {
            Matcher codeListIdMatcher = codeListIdPattern.matcher(codeListId);
            if (codeListIdMatcher.matches()) {
                targetCodeLists.put(codeListId, codeList);
            }
        }
    }

    if (logger.isDebugEnabled()) {
        logger.debug("registered codeList : {}", targetCodeLists.keySet());
    }

    this.codeLists = Collections.unmodifiableCollection(targetCodeLists.values());

}