Example usage for java.util Collections unmodifiableSet

List of usage examples for java.util Collections unmodifiableSet

Introduction

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

Prototype

public static <T> Set<T> unmodifiableSet(Set<? extends T> s) 

Source Link

Document

Returns an unmodifiable view of the specified set.

Usage

From source file:org.n52.iceland.binding.json.JSONBinding.java

@Override
public Set<BindingKey> getKeys() {
    return Collections.unmodifiableSet(KEYS);
}

From source file:org.web4thejob.web.panel.base.AbstractSettingAwarePanel.java

@Override
public Set<Setting<?>> getSettings() {
    return Collections.unmodifiableSet(new HashSet<Setting<?>>(settings.values()));
}

From source file:edu.wisc.my.stats.util.SortedKeyTable.java

/**
 * @param rowKeyComparator Comparator to order the row keys with, if null the natural ordering is used.
 * @param columnKeyComparator Comparator to order the column keys with, if null the natural ordering is used.
 *//*  w  w  w . ja va  2  s .  c o  m*/
public SortedKeyTable(final Comparator<R> rowKeyComparator, final Comparator<C> columnKeyComparator) {
    if (rowKeyComparator != null) {
        this.rowKeys = new TreeMap<R, Integer>(rowKeyComparator);
    } else {
        this.rowKeys = new TreeMap<R, Integer>();
    }

    if (columnKeyComparator != null) {
        this.columnKeys = new TreeMap<C, Integer>(columnKeyComparator);
    } else {
        this.columnKeys = new TreeMap<C, Integer>();
    }

    this.readOnlyRowKeysView = Collections.unmodifiableSet(this.rowKeys.keySet());
    this.readOnlyColumnKeysView = Collections.unmodifiableSet(this.columnKeys.keySet());
}

From source file:de.dhke.projects.cutil.collections.WeightedSet.java

@Override
public Set<Entry<K, Double>> entrySet() {
    return Collections.unmodifiableSet(_backend.entrySet());
}

From source file:com.opengamma.engine.function.blacklist.FunctionBlacklistRule.java

public void setInputs(final Collection<ValueSpecification> inputs) {
    if (inputs != null) {
        _inputs = Collections.unmodifiableSet(new HashSet<ValueSpecification>(inputs));
    } else {/*from  w w  w. j a  v  a 2  s  . c o m*/
        _inputs = null;
    }
}

From source file:WeakIdentityHashMap.java

public Set<Map.Entry<K, V>> entrySet() {
    reap();/*from w ww .j a  va 2s. c  o  m*/
    Set<Map.Entry<K, V>> ret = new HashSet<Map.Entry<K, V>>();
    for (Map.Entry<IdentityWeakReference, V> ref : backingStore.entrySet()) {
        final K key = ref.getKey().get();
        final V value = ref.getValue();
        Map.Entry<K, V> entry = new Map.Entry<K, V>() {
            public K getKey() {
                return key;
            }

            public V getValue() {
                return value;
            }

            public V setValue(V value) {
                throw new UnsupportedOperationException();
            }
        };
        ret.add(entry);
    }
    return Collections.unmodifiableSet(ret);
}

From source file:com.gargoylesoftware.htmlunit.CookieManager.java

/**
 * Returns the currently configured cookies, in an unmodifiable set.
 * If disabled, this returns an empty set.
 * @return the currently configured cookies, in an unmodifiable set
 *//*w w w .  j  a  v  a 2 s. c  om*/
public synchronized Set<Cookie> getCookies() {
    if (!isCookiesEnabled()) {
        return Collections.<Cookie>emptySet();
    }

    final Set<Cookie> copy = new LinkedHashSet<>();
    copy.addAll(cookies_);
    return Collections.unmodifiableSet(copy);
}

From source file:com.google.mr4c.util.CustomFormat.java

public Set<String> getNameSet() {
    return Collections.unmodifiableSet(m_nameSet);
}

From source file:edu.uci.ics.jung.graph.impl.SimpleSparseVertex.java

/**
 * @see Vertex#getSuccessors()//  w w  w  .ja  va2  s.  c  o m
 */
public Set getSuccessors() {
    Collection succs = CollectionUtils.union(getSuccsToOutEdges().keySet(), getNeighborsToEdges().keySet());

    return Collections.unmodifiableSet(new HashSet(succs));
}

From source file:com.conwet.silbops.model.Advertise.java

/**
 * @return a {@link Set} view of the current attributes.
 *//*from ww  w .j  a v a2s  .co m*/
@Override
public Set<Attribute> getAttributes() {

    return Collections.unmodifiableSet(attributes);
}