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.act.biointerpretation.networkanalysis.MetabolismNetwork.java

@JsonIgnore
@Override
public Collection<NetworkNode> getNodes() {
    return Collections.unmodifiableCollection(nodes);
}

From source file:graph.DependencyDirectedSparceMultiGraph.java

public Collection<V> getSuccessors(V vertex) {
    Set<V> succs = new HashSet<V>();
    for (E edge : getOutgoing_internal(vertex))
        succs.add(this.getDest(edge));

    return Collections.unmodifiableCollection(succs);
}

From source file:com.microsoft.alm.plugin.context.ServerContextManager.java

public synchronized Collection<ServerContext> getAllServerContexts() {
    //copy values from HashMap to a new List make sure the list is immutable
    return Collections.unmodifiableCollection(new ArrayList<ServerContext>(contextMap.values()));
}

From source file:at.yawk.buycraft.BuycraftApiImpl.java

@Override
public PendingResponse pending() throws IOException {
    JsonObject object = get("pendingUsers");
    List<String> pending = new ArrayList<>();
    JsonObject payload = object.getAsJsonObject("payload");
    payload.getAsJsonArray("pendingPlayers").forEach(ele -> pending.add(ele.getAsString()));
    return new PendingResponse(Collections.unmodifiableCollection(pending),
            payload.get("offlineCommands").getAsBoolean());
}

From source file:com.frank.search.solr.core.query.result.SolrResultPage.java

@Override
public Collection<Page<FacetFieldEntry>> getFacetResultPages() {
    return Collections.unmodifiableCollection(this.facetResultPages.values());
}

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

public Collection<E> getEdges() {
    return Collections.unmodifiableCollection(edges.keySet());
}

From source file:cl.ucn.disc.zoome.zui.layout.OrderedSparseGraph.java

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

    // consider directed inedges and undirected
    Collection<V> preds = new HashSet<V>(vertex_maps.get(vertex)[INCOMING].keySet());
    preds.addAll(vertex_maps.get(vertex)[INCIDENT].keySet());
    return Collections.unmodifiableCollection(preds);
}

From source file:de.uniba.wiai.kinf.pw.projects.lillytab.reasoner.tbox.RBox.java

@Override
public Collection<R> getInverseRoles(R role) {
    if (!hasRole(role)) {
        throw new IllegalArgumentException(String.format("Unknown role `%s'", role));
    }//from   w w  w . j a va2  s . c o m

    final Collection<R> roles = _inverseRoles.get(role);
    if (roles != null) {
        return Collections.unmodifiableCollection(roles);
    } else {
        return null;
    }
}

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

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

    return Collections.unmodifiableCollection(getIncident_internal(vertex));
}

From source file:com.github.nethad.clustermeister.provisioning.ec2.AmazonNodeManager.java

public Collection<? extends Node> getNodes() {
    managedNodesMonitor.enter();/*from   ww  w . j  av a2  s  .co  m*/
    try {
        List<AmazonNode> allNodes = new ArrayList<AmazonNode>(drivers.size() + nodes.size());
        allNodes.addAll(nodes);
        allNodes.addAll(drivers);
        return Collections.unmodifiableCollection(allNodes);
    } finally {
        managedNodesMonitor.leave();
    }
}