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.netflix.simianarmy.aws.janitor.crawler.EBSSnapshotJanitorCrawler.java

/**
 * Gets the collection of AMIs that are created using a specific snapshot.
 * @param snapshotId the snapshot id//from w w  w .ja va  2 s  .  co  m
 */
protected Collection<String> getAMIsForSnapshot(String snapshotId) {
    Collection<String> amis = snapshotToAMIs.get(snapshotId);
    if (amis != null) {
        return Collections.unmodifiableCollection(amis);
    } else {
        return Collections.emptyList();
    }
}

From source file:com.phoenixst.plexus.util.UnmodifiableGraph.java

public Collection incidentEdges(Object node, Predicate traverserPredicate) {
    return Collections.unmodifiableCollection(delegate.incidentEdges(node, traverserPredicate));
}

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

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

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

    return Collections.unmodifiableCollection(succs);
}

From source file:graph.DependencyDirectedSparceMultiGraph.java

public Collection<E> getInEdges(V vertex) {
    return Collections.unmodifiableCollection(getIncoming_internal(vertex));
}

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

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

    // combine directed inedges and undirected
    Collection<E> in = new HashSet<E>(vertex_maps.get(vertex)[INCOMING].values());
    in.addAll(vertex_maps.get(vertex)[INCIDENT].values());
    return Collections.unmodifiableCollection(in);
}

From source file:org.jasig.cas.web.report.SingleSignOnSessionsReportController.java

/**
 * Gets sso sessions./*from w ww  .  j a v a2  s . c om*/
 *
 * @return the sso sessions
 */
private Collection<Map<String, Object>> getSsoSessions() {
    final List<Map<String, Object>> activeSessions = new ArrayList<Map<String, Object>>();

    for (final Ticket ticket : getNonExpiredTicketGrantingTickets()) {
        final TicketGrantingTicket tgt = (TicketGrantingTicket) ticket;

        final Map<String, Object> sso = new HashMap<>(SsoSessionAttributeKeys.values().length);
        sso.put(SsoSessionAttributeKeys.AUTHENTICATED_PRINCIPAL.toString(),
                tgt.getAuthentication().getPrincipal().getId());
        sso.put(SsoSessionAttributeKeys.AUTHENTICATION_DATE.toString(),
                tgt.getAuthentication().getAuthenticationDate());
        sso.put(SsoSessionAttributeKeys.NUMBER_OF_USES.toString(), tgt.getCountOfUses());
        if (this.includeTicketGrantingTicketId) {
            sso.put(SsoSessionAttributeKeys.TICKET_GRANTING_TICKET.toString(), tgt.getId());
        }

        activeSessions.add(Collections.unmodifiableMap(sso));
    }
    return Collections.unmodifiableCollection(activeSessions);
}

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

public Collection<E> getIncidentEdges(V vertex) {
    if (!containsVertex(vertex))
        return null;
    return Collections.unmodifiableCollection(vertices.get(vertex).values());
}

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

public Collection<Concept> getBroaderConcepts() {
    return Collections.unmodifiableCollection(this.broaderConcepts);
}

From source file:graph.DependencyDirectedSparceMultiGraph.java

public Collection<E> getOutEdges(V vertex) {
    return Collections.unmodifiableCollection(getOutgoing_internal(vertex));
}

From source file:de.csdev.ebus.service.device.EBusDeviceTable.java

public Collection<EBusDevice> getDeviceTable() {
    return Collections.unmodifiableCollection(deviceTable.values());
}