Example usage for java.util Collection addAll

List of usage examples for java.util Collection addAll

Introduction

In this page you can find the example usage for java.util Collection addAll.

Prototype

boolean addAll(Collection<? extends E> c);

Source Link

Document

Adds all of the elements in the specified collection to this collection (optional operation).

Usage

From source file:es.ucm.fdi.dalgs.externalActivity.repository.ExternalActivityRepository.java

@SuppressWarnings("unchecked")
// where s.product.category in" +" (select sb.pbyte from SimpleBean sb where sb.pint>=30000)");
public Collection<? extends Activity> getExternalActivitiesAll() {
    //   Query query = em.createQuery( "select a from Activity  a inner join Course  c  where c = a.course and a in (select ea from Course c join c.external_activities ea)");// union (select * from _activity  a inner join group_external  ge  where ge.id_activity =  a.id_activity)");
    Query query = em.createQuery(
            "select a from Activity  a inner join a.course  c inner join c.external_activities ea where  a = ea ");

    Query query2 = em.createQuery(
            "select aa from Activity  aa inner join aa.group  g inner join g.external_activities eaa where  aa = eaa)");
    Collection<Activity> col = new ArrayList<Activity>();
    col.addAll(query.getResultList());
    col.addAll(query2.getResultList());/* w w w  .  j  a  va2 s  .c  om*/
    return col;
}

From source file:com.carmanconsulting.cassidy.pojo.assembly.step.CollectionStep.java

@Override
@SuppressWarnings("unchecked")
public void execute(AssemblyStack assemblyStack) {
    List<Object> elements = assemblyStack.drain();
    Collection<Object> collection = CassidyUtils.instantiate(collectionType);
    collection.addAll(elements);
    assemblyStack.push(collection);//from   w w w.  j  a  v  a  2 s.  c  o m
}

From source file:io.github.jeddict.orm.generator.compiler.constraints.EmailSnippet.java

@Override
public Collection<String> getImportSnippets() throws InvalidDataException {
    Collection<String> imports = super.getImportSnippets();
    imports.addAll(flags.stream().map(Flag::name)
            .map(flag -> "static " + BV_CONSTRAINTS_PACKAGE + ".Email.Flag." + flag).collect(toList()));
    return imports;
}

From source file:io.github.jeddict.orm.generator.compiler.constraints.PatternSnippet.java

@Override
public Collection<String> getImportSnippets() throws InvalidDataException {
    Collection<String> imports = super.getImportSnippets();
    imports.addAll(flags.stream().map(Flag::name)
            .map(flag -> "static " + BV_CONSTRAINTS_PACKAGE + ".Pattern.Flag." + flag).collect(toList()));
    return imports;
}

From source file:com.github.ukase.toolkit.CompoundSource.java

@Override
public Collection<String> getFontsUrls() {
    Collection<String> fonts = new ArrayList<>(fileSource.getFontsUrls());
    fonts.addAll(jarSource.getFontsUrls());
    return fonts;
}

From source file:com.qwazr.utils.json.client.JsonMultiClientAbstract.java

/**
 * Fill a collection with the URLs of the clients
 * //from  w w w .ja  v  a  2  s . co m
 * @param urlCollection
 *            The collection to fill
 */
public void fillClientUrls(Collection<String> urlCollection) {
    urlCollection.addAll(clientsMap.keySet());
}

From source file:de.iew.web.isc.DSResponseCollection.java

public void setCollectionData(Collection data) {
    Collection existingData = getClearedDataStore();
    existingData.addAll(data);
}

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

@Override
public Collection<E> getIncidentEdges(V vertex) {
    if (!containsVertex(vertex))
        return null;
    Collection<E> incident = new LinkedHashSet<E>();
    incident.addAll(getIncoming_internal(vertex));
    incident.addAll(getOutgoing_internal(vertex));
    return incident;
}

From source file:org.opcfoundation.ua.transport.https.HttpsServerConnection.java

@Override
public void getSecureChannels(Collection<ServerSecureChannel> list) {
    list.addAll(secureChannels.values());
}

From source file:org.glenans.extractor.controller.StageController.java

/**
 * @param stages/*w w w. j  av  a2  s.  co  m*/
 * @param predicate : a predicate which can be one or many picked from: city, names, duration
 * @return
 */
private Collection<Stage> filterStage(Collection<Stage> stages, Predicate predicate) {
    // copy all stages in a list because CollectionUtils.filter modifies the list
    Collection<Stage> stagesCopy = new ArrayList<>();
    stagesCopy.addAll(stages);
    CollectionUtils.filter(stagesCopy, predicate);
    return stagesCopy;
}