List of usage examples for com.google.common.collect Sets newLinkedHashSet
public static <E> LinkedHashSet<E> newLinkedHashSet()
From source file:de.tu_berlin.dima.oligos.SparseSchema.java
public Set<String> emptyTablesIn(final String schema) { Set<String> emptyTables = Sets.newLinkedHashSet(); for (String table : tablesIn(schema)) { if (schemas.get(schema).get(table).isEmpty()) { emptyTables.add(table);/*from ww w . j a v a 2s. c om*/ } } return emptyTables; }
From source file:com.github.ferstl.maven.pomenforcers.PedanticPomSectionOrderEnforcer.java
public PedanticPomSectionOrderEnforcer() { this.sectionPriorities = Sets.newLinkedHashSet(); }
From source file:org.eclipse.sirius.editor.tools.internal.menu.refactoring.RefactoringMenu.java
private Collection generateRefactoringActions(final ISelection selection, final IEditorPart editor) { // We first build all candidate Actions Set<AbstractEObjectRefactoringAction> allActions = Sets.newLinkedHashSet(); allActions.add(new MaterializeTemplateRefactoring(editor, selection)); // We only add to the menu the actions that have a valid selection return Sets.filter(allActions, new Predicate<AbstractEObjectRefactoringAction>() { public boolean apply(AbstractEObjectRefactoringAction candidateAction) { return candidateAction.isSelectionValid(); }//from w w w .j a va2s . co m }); }
From source file:org.eclipse.emf.eson.ui.generators.ExtendedJdtBasedProcessorProvider.java
public URLClassLoader createClassLoaderForJavaProject(final IJavaProject projectToUse) { // do NOT use return super.createClassLoaderForJavaProject(projectToUse); // because that uses boolean includeOutputFolder = false instead of true: LinkedHashSet<URL> urls = Sets.newLinkedHashSet(); try {// w w w . ja v a 2 s. c o m collectClasspathURLs(projectToUse, urls, true, new LinkedHashSet<IJavaProject>()); } catch (JavaModelException e) { if (!e.isDoesNotExist()) logger.error(e.getMessage(), e); } return new URLClassLoader(urls.toArray(new URL[0]), getParentClassLoader()); }
From source file:com.google.gxp.testing.BaseErrorTestCase.java
@Override protected CompilationSet compileFiles(Collection<FileRef> gxpFiles) { CompilationSet result = super.compileFiles(gxpFiles); // TODO(laurence): check alerts from DynamicImplJava separately from Java. // They should generate the same alerts. // collect actualAlerts and reset expectedAlerts actualAlerts = alertSetBuilder.buildAndClear(); expectedAlerts = Sets.newLinkedHashSet(); return result; }
From source file:com.intelligentsia.dowsers.entity.store.MetaEntityStoreSupport.java
@Override public Collection<MetaEntity> find(final Reference reference) throws NullPointerException { final Collection<MetaEntity> result = Sets.newLinkedHashSet(); // we are looking for MetaEntity with attribute 'name' equals to // EntityClassName in reference parameter. final Reference target = new Reference(MetaEntity.class, "name", Preconditions.checkNotNull(reference).getEntityClassName()); try {/*from w ww .j a v a2s. c o m*/ for (final Reference ref : entityStore.find(target)) { result.add(entityStore.find(MetaEntity.class, ref)); } } catch (final EntityNotFoundException entityNotFoundException) { // oups } return result; }
From source file:org.apache.whirr.DynamicClusterControllerFactory.java
/** * Return a collection of available {@link ClusterController} names. * @return the available service names// ww w . j a va 2 s . c om */ @Override public Set<String> availableServices() { Set<String> result = Sets.newLinkedHashSet(); for (Map.Entry<String, ClusterController> entry : clusterControllerMap.entrySet()) { result.add(entry.getKey()); } return result; }
From source file:org.artifactory.storage.db.fs.dao.ArchiveEntriesDao.java
@Nonnull public Set<ArchiveEntry> loadByChecksum(String archiveSha1) throws SQLException { ResultSet resultSet = null;//from w w w. j a v a 2s. c om Set<ArchiveEntry> entries = Sets.newLinkedHashSet(); try { resultSet = jdbcHelper.executeSelect("SELECT ia.archive_sha1, ap.entry_path, an.entry_name FROM " + "indexed_archives ia, indexed_archives_entries iae, archive_paths ap , archive_names an " + "WHERE ia.indexed_archives_id=iae.indexed_archives_id " + "AND iae.entry_path_id=ap.path_id " + "AND iae.entry_name_id=an.name_id " + "AND ia.archive_sha1 = ?", archiveSha1); while (resultSet.next()) { entries.add(entryFromResultSet(resultSet)); } return entries; } finally { DbUtils.close(resultSet); } }
From source file:org.eclipse.sirius.diagram.ui.tools.internal.palette.PaletteToolFilterDescriptionListenersManager.java
/** * Init the manager.//from w ww . ja va 2s . c o m * * @param gmfDiagram * the GMF diagram */ public void init(Diagram gmfDiagram) { /* remove previously registered listeners */ removeListeners(); this.diagram = gmfDiagram; this.domain = TransactionUtil.getEditingDomain(diagram); listeners = Sets.newLinkedHashSet(); }
From source file:com.facebook.buck.counters.CounterRegistryImpl.java
public CounterRegistryImpl(ScheduledExecutorService service, BuckEventBus eventBus, long firstFlushIntervalMillis, long flushIntervalMillis) { this.counters = Sets.newLinkedHashSet(); this.eventBus = eventBus; flushCountersFuture = service.scheduleAtFixedRate(this::flushCounters, /* initialDelay */ firstFlushIntervalMillis, /* period */ flushIntervalMillis, /* unit */ TimeUnit.MILLISECONDS); eventBus.register(this); }