List of usage examples for com.google.common.collect Sets newLinkedHashSet
public static <E> LinkedHashSet<E> newLinkedHashSet(Iterable<? extends E> elements)
From source file:com.mysema.query.util.CollectionUtils.java
public static <T> Set<T> copyOfSorted(Set<T> set) { if (set instanceof ImmutableSet) { return set; } else {/*from w w w . ja v a2 s . co m*/ return Sets.newLinkedHashSet(set); } }
From source file:org.jclouds.tmrk.enterprisecloud.domain.Tasks.java
private Tasks(Set<Task> tasks) { this.tasks = Sets.newLinkedHashSet(tasks); }
From source file:org.gradle.plugins.ide.eclipse.model.WtpFacet.java
private void removeDuplicates() { this.facets = Lists.newArrayList(Sets.newLinkedHashSet(facets)); }
From source file:eu.numberfour.n4js.scoping.imports.AmbiguousImportDescription.java
@Override public String getMessage() { StringBuilder typeListStr = new StringBuilder(); IdentifiableElement first = (IdentifiableElement) EcoreUtil.resolve(getEObjectOrProxy(), context); String typeIdent = first instanceof Type ? "type" : "variable"; TModule module = (TModule) first.eContainer(); typeListStr.append(module.getQualifiedName()); Set<IdentifiableElement> uniqueTypes = Sets.newLinkedHashSet(elements); uniqueTypes.remove(first);/*ww w. j a v a 2 s . c o m*/ Iterator<IdentifiableElement> iter = uniqueTypes.iterator(); while (iter.hasNext()) { IdentifiableElement type = iter.next(); if (iter.hasNext()) { typeListStr.append(", "); } else { typeListStr.append(" and "); } typeListStr.append(((TModule) type.eContainer()).getQualifiedName()); } if (this.issueCode == IssueCodes.IMP_AMBIGUOUS_WILDCARD) { return IssueCodes.getMessageForIMP_AMBIGUOUS_WILDCARD(typeIdent, getName(), typeListStr.toString()); } else if (this.issueCode == IssueCodes.IMP_AMBIGUOUS) { return IssueCodes.getMessageForIMP_AMBIGUOUS(typeIdent, getName(), typeListStr.toString()); } else if (this.issueCode == IssueCodes.IMP_DUPLICATE_NAMESPACE) { return IssueCodes.getMessageForIMP_DUPLICATE_NAMESPACE(getName(), "stub"); } return "Unknown ambiguous import issue: " + this.issueCode + " for " + context + "."; }
From source file:org.jclouds.tmrk.enterprisecloud.domain.hardware.Disks.java
private Disks(Set<VirtualDisk> disks) { this.disks = Sets.newLinkedHashSet(disks); }
From source file:org.eclipse.sirius.ui.tools.internal.actions.session.OpenRepresentationsAction.java
/** * Constructor./*from w ww . j a v a 2 s . c o m*/ * * @param representations * representations to open. */ public OpenRepresentationsAction(Collection<DRepresentation> representations) { super(Messages.OpenRepresentationsAction_name); if (representations != null) { this.representationsToOpen = Sets .newLinkedHashSet(Iterables.filter(representations, Predicates.notNull())); } }
From source file:org.jclouds.tmrk.enterprisecloud.domain.resource.cpu.CpuUsageDetails.java
private CpuUsageDetails(Set<ComputePoolCpuUsageDetailSummaryEntry> entries) { this.entries = Sets.newLinkedHashSet(entries); }
From source file:com.textocat.textokit.postagger.PosTrimmer.java
public void trim(JCas jCas, Wordform wf) { StringArray grammemsFS = wf.getGrammems(); Set<String> grammems = Sets.newLinkedHashSet(FSUtils.toSet(grammemsFS)); if (grammems.retainAll(targetTags)) { wf.setGrammems(FSUtils.toStringArray(jCas, grammems)); }//from www .ja va2 s .c o m }
From source file:org.jclouds.tmrk.enterprisecloud.domain.template.TemplateFamilies.java
private TemplateFamilies(Set<TemplateFamily> families) { this.families = Sets.newLinkedHashSet(families); }
From source file:org.apache.lens.server.query.collect.DefaultEstimatedQueryCollection.java
@Override public Set<QueryContext> getQueries(final LensDriver driver) { final Collection<QueryContext> driverQueries = getQueriesCollectionForDriver(driver); return Sets.newLinkedHashSet(driverQueries); }