Example usage for org.apache.commons.collections15 CollectionUtils unmodifiableCollection

List of usage examples for org.apache.commons.collections15 CollectionUtils unmodifiableCollection

Introduction

In this page you can find the example usage for org.apache.commons.collections15 CollectionUtils unmodifiableCollection.

Prototype

public static <E> Collection<E> unmodifiableCollection(Collection<E> collection) 

Source Link

Document

Returns an unmodifiable collection backed by the given collection.

Usage

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

/**
 * @see edu.uci.ics.jung.graph.Tree#getChildEdges(java.lang.Object)
 *//*from   ww w.  j  a  v  a2  s  .com*/
public Collection<E> getChildEdges(V vertex) {
    if (!containsVertex(vertex))
        return null;
    List<E> edges = vertex_data.get(vertex).child_edges;
    return edges == null ? Collections.<E>emptySet() : CollectionUtils.unmodifiableCollection(edges);
}

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

/**
 * Returns an ordered list of {@code vertex}'s child vertices.
 * If there is no child in position i, then the list will contain
 * {@code null} in position i.  If {@code vertex} has no children
 * then the empty set will be returned./*from w  w w . j  a v a 2  s  .co m*/
 * @see edu.uci.ics.jung.graph.Tree#getChildren(java.lang.Object)
 */
public Collection<V> getChildren(V vertex) {
    if (!containsVertex(vertex))
        return null;
    List<E> edges = vertex_data.get(vertex).child_edges;
    if (edges == null)
        return Collections.emptySet();
    Collection<V> children = new ArrayList<V>(order);
    for (E edge : edges)
        children.add(this.getOpposite(vertex, edge));
    return CollectionUtils.unmodifiableCollection(children);
}

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

/**
 * @see edu.uci.ics.jung.graph.Hypergraph#getEdges()
 */
public Collection<E> getEdges() {
    return CollectionUtils.unmodifiableCollection(edge_vpairs.keySet());
}

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

/**
 * @see edu.uci.ics.jung.graph.Hypergraph#getVertices()
 */
public Collection<V> getVertices() {
    return CollectionUtils.unmodifiableCollection(vertex_data.keySet());
}