List of usage examples for com.google.common.collect Iterables addAll
public static <T> boolean addAll(Collection<T> addTo, Iterable<? extends T> elementsToAdd)
From source file:com.addthis.ccompressor.ColumnRowCompressor.java
@Override public boolean write(Iterable<Bundle> rows, OutputStream outputStream) throws IOException { assert (rows != null); Iterables.addAll(rowBuffer, rows); return maybeFlush(outputStream); }
From source file:io.druid.segment.indexing.granularity.UniformGranularitySpec.java
@JsonCreator public UniformGranularitySpec(@JsonProperty("segmentGranularity") Granularity segmentGranularity, @JsonProperty("queryGranularity") QueryGranularity queryGranularity, @JsonProperty("intervals") List<Interval> inputIntervals ) {//from w ww.j a v a 2 s .com this.segmentGranularity = segmentGranularity == null ? DEFAULT_SEGMENT_GRANULARITY : segmentGranularity; this.queryGranularity = queryGranularity == null ? DEFAULT_QUERY_GRANULARITY : queryGranularity; if (inputIntervals != null) { List<Interval> granularIntervals = Lists.newArrayList(); for (Interval inputInterval : inputIntervals) { Iterables.addAll(granularIntervals, this.segmentGranularity.getIterable(inputInterval)); } this.inputIntervals = ImmutableList.copyOf(inputIntervals); this.wrappedSpec = new ArbitraryGranularitySpec(queryGranularity, granularIntervals); } else { this.inputIntervals = null; this.wrappedSpec = null; } }
From source file:com.analog.lyric.dimple.schedulers.scheduleEntry.SubScheduleEntry.java
@Override public Iterable<? extends INode> getNodes() { List<INode> nodes = new ArrayList<>(); for (IScheduleEntry subentry : _subschedule) { Iterables.addAll(nodes, subentry.getNodes()); }/* ww w . j av a 2 s . c o m*/ return nodes; }
From source file:org.apache.isis.core.unittestsupport.soap.SoapEndpointPublishingRule.java
public SoapEndpointPublishingRule(final Iterable<SoapEndpointSpec> soapEndpointSpecs) { Iterables.addAll(this.soapEndpointSpecs, soapEndpointSpecs); }
From source file:r.lang.ListVector.java
public ListVector(Iterable<? extends SEXP> values, PairList attributes) { super(Null.INSTANCE, attributes); this.values = new ArrayList<SEXP>(); Iterables.addAll(this.values, values); }
From source file:uk.co.flax.luwak.termextractor.BooleanTermExtractor.java
@Override public void extract(BooleanQuery query, List<QueryTerm> terms, List<Extractor<?>> extractors) { Analyzer checker = new Analyzer(query); if (checker.isDisjunctionQuery()) { for (Query subquery : checker.getDisjunctions()) { extractTerms(subquery, terms, extractors); }//from w ww.j av a 2 s . c o m } else if (checker.isConjunctionQuery()) { List<QueryTermList> termlists = new ArrayList<>(); for (Query subquery : checker.getConjunctions()) { List<QueryTerm> subTerms = new ArrayList<>(); extractTerms(subquery, subTerms, extractors); termlists.add(new QueryTermList(this.weightor, subTerms)); } Iterables.addAll(terms, QueryTermList.selectBest(termlists)); } }
From source file:org.eclipse.osee.framework.ui.skynet.search.IdArtifactSearch.java
@Override public Collection<Artifact> getArtifacts() throws Exception { List<Integer> artIds = new LinkedList<Integer>(); List<String> guids = new LinkedList<String>(); for (String id : Arrays.asList(searchString.split("[\\s,]+"))) { if (Strings.isNumeric(id)) { artIds.add(Integer.parseInt(id)); } else {/*from ww w. j av a2s . c o m*/ guids.add(id); } } List<Artifact> toReturn = new LinkedList<Artifact>(); if (!artIds.isEmpty()) { QueryBuilderArtifact query = ArtifactQuery.createQueryBuilder(branchToSearch); query.andLocalIds(artIds); Iterables.addAll(toReturn, query.getResults()); } if (!guids.isEmpty()) { QueryBuilderArtifact query = ArtifactQuery.createQueryBuilder(branchToSearch); query.andGuids(guids); Iterables.addAll(toReturn, query.getResults()); } return toReturn; }
From source file:com.google.javascript.jscomp.MemoizedTypedScopeCreator.java
@Override public Iterable<TypedVar> getAllSymbols() { List<TypedVar> vars = new ArrayList<>(); for (TypedScope s : scopes.values()) { Iterables.addAll(vars, s.getAllSymbols()); }//ww w .ja va 2 s . com return vars; }
From source file:org.jclouds.vcloud.domain.internal.CatalogImpl.java
public CatalogImpl(String name, String type, URI href, ReferenceType org, @Nullable String description, Map<String, ReferenceType> contents, Iterable<Task> tasks, boolean published, boolean readOnly) { this.name = checkNotNull(name, "name"); this.type = checkNotNull(type, "type"); this.org = org;// TODO: once <1.0 is killed check not null this.description = description; this.href = checkNotNull(href, "href"); putAll(checkNotNull(contents, "contents")); Iterables.addAll(this.tasks, checkNotNull(tasks, "tasks")); this.published = published; this.readOnly = readOnly; }
From source file:com.zimbra.soap.admin.message.GetZimletStatusResponse.java
public void setCoses(Iterable<ZimletStatusCos> coses) { this.coses.clear(); if (coses != null) { Iterables.addAll(this.coses, coses); }/*from ww w . j a v a2 s.com*/ }