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:edu.memphis.ccrg.lida.proceduralmemory.ProceduralMemoryImpl.java

@Override
public Object getModuleContent(Object... params) {
    if ("schemes".equals(params[0])) {
        return Collections.unmodifiableCollection(schemeSet);
    }//from w  w  w  . j ava2s.  c om
    return null;
}

From source file:edu.memphis.ccrg.lida.proceduralmemory.ProceduralMemoryImpl.java

/**
 * Gets the condition pool. Method intended for testing only.
 * @return an {@link UnmodifiableCollection} of the condition in the pool
 *//*from   w ww  .  j a  va2 s  .co  m*/
public Collection<Condition> getConditionPool() {
    return Collections.unmodifiableCollection(conditionPool.values());
}

From source file:de.btobastian.javacord.entities.message.impl.ImplMessage.java

@Override
public Collection<Embed> getEmbeds() {
    return Collections.unmodifiableCollection(embeds);
}

From source file:me.st28.flexseries.flexchat.backend.channel.ChannelManagerImpl.java

/**
 * @return An unmodifiable collection of all loaded channels.
 *//*from   ww w. j  a  v a  2 s  .  c  om*/
public Collection<Channel> getChannels() {
    return Collections.unmodifiableCollection(channels.values());
}

From source file:Librarian.java

/**
 * Gets the books
 * 
 * @return Collection
 */
public Collection getBooks() {
    return Collections.unmodifiableCollection(books);
}

From source file:com.att.research.xacml.admin.model.GitRepositoryContainer.java

@Override
public Collection<File> getItemIds() {

    if (recursive) {
        final Collection<File> col = new ArrayList<File>();
        for (int i = 0; i < roots.length; i++) {
            addItemIds(col, roots[i]);// w w  w. ja  v  a 2 s  . com
        }
        return Collections.unmodifiableCollection(col);
    } else {
        File[] f;
        if (roots.length == 1) {
            if (filter != null) {
                f = roots[0].listFiles(filter);
            } else {
                f = roots[0].listFiles();
            }
        } else {
            f = roots;
        }

        if (f == null) {
            return Collections.unmodifiableCollection(new LinkedList<File>());
        }

        final List<File> l = Arrays.asList(f);
        Collections.sort(l);
        return Collections.unmodifiableCollection(l);
    }

}

From source file:com.haulmont.cuba.desktop.gui.components.DesktopPickerField.java

@Override
public Collection<Action> getActions() {
    return Collections.unmodifiableCollection(actionsOrder);
}

From source file:edu.ksu.cis.indus.common.soot.SootBasedDriver.java

/**
 * Loads up the classes specified via <code>setClassNames()</code> and also collects the possible entry points into the
 * system being analyzed. All <code>public static void main()</code> methods defined in <code>public</code> classes
 * that are named via <code>args</code>are considered as entry points. It uses the classpath set via
 * <code>addToSootClassPath</code>.
 * //from  www . j a  v a 2s.  c om
 * @param options to be used while setting up Soot infrastructure.
 * @return a soot scene that provides the classes to be analyzed.
 */
@NonNull
private Scene loadupClassesAndCollectMains(@NonNull final String[] options) {
    final Scene _result = Scene.v();
    String _temp = _result.getSootClassPath();
    Options.v().parse(options);

    if (_temp != null) {
        _temp += File.pathSeparator + classpathToAdd + File.pathSeparator
                + System.getProperty("java.class.path");
    } else {
        _temp = classpathToAdd;
    }
    _result.setSootClassPath(_temp);

    for (final Iterator<String> _i = classNames.iterator(); _i.hasNext();) {
        final SootClass _sc = _result.loadClassAndSupport(_i.next());
        _sc.setApplicationClass();
    }

    final Collection<SootClass> _mc = new HashSet<SootClass>();
    _mc.addAll(_result.getClasses());

    RootMethodTrapper _rmt = rootMethodTrapper;

    if (_rmt == null) {
        _rmt = DEFAULT_INSTANCE_OF_ROOT_METHOD_TRAPPER;
    }

    _rmt.setClassNames(Collections.unmodifiableCollection(classNames));

    for (final Iterator<SootClass> _i = _mc.iterator(); _i.hasNext();) {
        final SootClass _sc = _i.next();

        if (_rmt.considerClassForEntryPoint(_sc)) {
            final Collection<SootMethod> _methods = _sc.getMethods();

            for (final Iterator<SootMethod> _j = _methods.iterator(); _j.hasNext();) {
                final SootMethod _sm = _j.next();

                if (_rmt.isThisARootMethod(_sm)) {
                    rootMethods.add(_sm);
                }
            }
        }
    }
    Util.fixupThreadStartBody(_result);

    if (Constants.shouldLoadMethodBodiesDuringInitialization()) {
        loadupMethodBodies();
    }

    return _result;
}

From source file:org.alfresco.module.org_alfresco_module_rm.caveat.RMCaveatConfigComponentImpl.java

public Collection<String> getRMConstraintNames() {
    Collection<String> rmConstraintNames = Collections.emptySet();
    try {// ww  w. j a va2 s .  co  m
        readLock.lock();
        rmConstraintNames = caveatConfig.getKeys();
    } finally {
        readLock.unlock();
    }
    return Collections.unmodifiableCollection(rmConstraintNames);
}

From source file:UnpackedJarFile.java

public static Collection<File> listRecursiveFiles(File file) {
    Collection<File> list = new ArrayList<File>();
    listRecursiveFiles(file, list);/*  w ww.  j  a v  a  2s  .  c o m*/
    return Collections.unmodifiableCollection(list);
}