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.mgmtp.jfunk.data.generator.data.IndexedFields.java

public Collection<Set<FieldSet>> getFieldSets() {
    return Collections.unmodifiableCollection(fieldSetsMap.values());
}

From source file:me.st28.flexseries.flexlib.plugin.FlexPlugin.java

/**
 * @return An unmodifiable collection of all global {@link FlexModule}s.
 *//*from w  w  w  .j a v  a 2  s  .  com*/
public static Collection<FlexModule> getGlobalModules() {
    return Collections.unmodifiableCollection(GLOBAL_MODULES.values());
}

From source file:io.github.minime89.passbeam.keyboard.Keycodes.java

public Keycodes(@ElementList(name = "keycodes", inline = true, required = true) Collection<Keycode> keycodes) {
    this.keycodes = Collections.unmodifiableCollection(keycodes);
}

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

/**
 * @return fields to request statistics of
 */
public Collection<Field> getFields() {
    return Collections.unmodifiableCollection(state.fields);
}

From source file:com.sg2net.utilities.ListaCAP.Comune.java

public Collection<String> getCodiciCap() {
    return Collections.unmodifiableCollection(cap);
}

From source file:com.haulmont.cuba.gui.ComponentsHelper.java

/**
 * Returns the collection of components within the specified container and all of its children.
 *
 * @param container container to start from
 * @return          collection of components
 *//* w  w w  . j  a  v  a2 s .  co  m*/
public static Collection<Component> getComponents(Component.Container container) {
    // do not return LinkedHashSet, it uses much more memory than ArrayList
    Collection<Component> res = new ArrayList<>();

    fillChildComponents(container, res);

    if (res.isEmpty()) {
        return Collections.emptyList();
    }

    return Collections.unmodifiableCollection(res);
}

From source file:net.ontopia.topicmaps.impl.basic.index.IdentifierIndex.java

@Override
public Collection<LocatorIF> getSubjectIdentifiersByPrefix(String prefix) {
    return Collections.unmodifiableCollection(
            CollectionUtils.select(getSubjectIdentifiers(), new LocatorPrefixedPredicate(prefix)));
}

From source file:com.netflix.simianarmy.conformity.Conformity.java

/**
 * Gets the components that cause the conformity check to fail.
 * @return/*from   w ww  .j a va2s  .  c  o  m*/
 *      the components that cause the conformity check to fail
 */
public Collection<String> getFailedComponents() {
    return Collections.unmodifiableCollection(failedComponents);
}

From source file:com.sonatype.nexus.perftest.PerformanceTest.java

@JsonCreator
public PerformanceTest(@JsonProperty("name") String name, @JsonProperty("duration") Duration duration,
        @JsonProperty("swarms") Collection<ClientSwarm> swarms) {
    this.name = name;
    this.duration = duration;
    this.swarms = Collections.unmodifiableCollection(new ArrayList<>(swarms));
}

From source file:fuzzy.df.CentroidDefuzzificationFunction.java

/**
* {@inheritDoc}/*from   w w  w .j a  va 2s  .c o  m*/
*
* @throws IllegalArgumentException if total area is zero
*/
public Double evaluate(NumericRange<T> x, MembershipFunction<T> mf) {
    Collection<T> values = Collections.unmodifiableCollection(x.toCollection());
    Collection<Double> fuzzyValues = new ArrayList<Double>();
    for (T crispValue : values) {
        fuzzyValues.add(mf.evaluate(crispValue));
    }
    double totalArea = Sum.of(fuzzyValues);
    if (totalArea == 0)
        throw new IllegalArgumentException("Total area is zero in centroid defuzzification!");
    Collection<Double> product = CrispFuzzyProduct.of(x.toCollection(), mf);
    double sum2 = Sum.of(product);
    double out = sum2 / totalArea;
    return out;
}