當前位置: 首頁>>代碼示例>>Java>>正文


Java MutableMultimap類代碼示例

本文整理匯總了Java中org.eclipse.collections.api.multimap.MutableMultimap的典型用法代碼示例。如果您正苦於以下問題:Java MutableMultimap類的具體用法?Java MutableMultimap怎麽用?Java MutableMultimap使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MutableMultimap類屬於org.eclipse.collections.api.multimap包,在下文中一共展示了MutableMultimap類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getPlatformInclusionPredicate

import org.eclipse.collections.api.multimap.MutableMultimap; //導入依賴的package包/類
private Predicate<? super ChecksumEntry> getPlatformInclusionPredicate(DbEnvironment env) {
    // 1) exclude those tables that are excluded by default from source code, e.g. explain tables or others that users configure
    ImmutableSet<Predicate<? super ChecksumEntry>> schemaObjectNamePredicates = env.getSchemas().collect(new Function<Schema, Predicate<? super ChecksumEntry>>() {
        @Override
        public Predicate<? super ChecksumEntry> valueOf(Schema schema) {
            return schema.getObjectExclusionPredicateBuilder().build(ChecksumEntry.TO_OBJECT_TYPE, ChecksumEntry.TO_NAME1);
        }
    });

    // 2) exclude the audit tables
    MutableMultimap<String, String> tablesToExclude = Multimaps.mutable.set.empty();

    tablesToExclude.putAll(ChangeType.TABLE_STR, Sets.immutable.with(
            env.getPlatform().convertDbObjectName().valueOf(getArtifactDeployerDao().getAuditContainerName()),
            env.getPlatform().convertDbObjectName().valueOf(dbChecksumManager.getChecksumContainerName()),
            env.getPlatform().convertDbObjectName().valueOf(getDeployExecutionDao().getExecutionContainerName()),
            env.getPlatform().convertDbObjectName().valueOf(getDeployExecutionDao().getExecutionAttributeContainerName())
    ));
    ObjectTypeAndNamePredicateBuilder auditTablePredicateBuilder = new ObjectTypeAndNamePredicateBuilder(tablesToExclude.toImmutable(), ObjectTypeAndNamePredicateBuilder.FilterType.EXCLUDE);
    Predicates<? super ChecksumEntry> auditTablePredicate = auditTablePredicateBuilder.build(ChecksumEntry.TO_OBJECT_TYPE, ChecksumEntry.TO_NAME1);

    return Predicates.and(auditTablePredicate, Predicates.and(schemaObjectNamePredicates));
}
 
開發者ID:goldmansachs,項目名稱:obevo,代碼行數:24,代碼來源:DbDeployer.java

示例2: filterAndGroupByAgeECEager_parallel

import org.eclipse.collections.api.multimap.MutableMultimap; //導入依賴的package包/類
@Benchmark
public MutableMultimap<Integer, Person> filterAndGroupByAgeECEager_parallel()
{
    Collection<Person> select =
            ParallelIterate.select(Person.getECPeople(), person -> person.getHeightInInches() < 150);
    MutableMultimap<Integer, Person> grouped =
            ParallelIterate.groupBy(select, Person::getAge);
    return grouped;
}
 
開發者ID:BNYMellon,項目名稱:CodeKatas,代碼行數:10,代碼來源:PersonJMHTest.java

示例3: itemsBySuppliers

import org.eclipse.collections.api.multimap.MutableMultimap; //導入依賴的package包/類
/**
 * Create a Multimap where the keys are the names of items and the values are the Suppliers that supply them.
 * A Supplier is associated to many item names.
 */
@Test
public void itemsBySuppliers()
{
    MutableMultimap<String, Supplier> itemsToSuppliers = null;

    Verify.assertIterableSize("should be 2 suppliers for sofa", 2, itemsToSuppliers.get("sofa"));
}
 
開發者ID:eclipse,項目名稱:eclipse-collections-kata,代碼行數:12,代碼來源:Exercise7Test.java

示例4: readChanges

import org.eclipse.collections.api.multimap.MutableMultimap; //導入依賴的package包/類
@Override
public ImmutableList<Change> readChanges(boolean useBaseline) {

    MutableList<Change> allChanges = Lists.mutable.empty();

    ImmutableSet<String> envSchemas = env.getSchemaNames().collect(this.convertDbObjectName);

    for (FileObject sourceDir : env.getSourceDirs()) {
        for (FileObject schemaDir : sourceDir.findFiles(new BasicFileSelector(and(vcsAware(), directory()), false))) {
            String schema = schemaDir.getName().getBaseName();

            if (envSchemas.contains(this.convertDbObjectName.valueOf(schema))) {
                MutableList<Change> schemaChanges = Lists.mutable.empty();

                for (ChangeType changeType : env.getPlatform().getChangeTypes()) {
                    FileObject changeTypeDir = this.findDirectoryForChangeType(schemaDir, changeType);

                    if (changeTypeDir != null) {
                        ImmutableList<Change> changes;
                        if (changeType.isRerunnable()) {
                            changes = findChanges(changeType, changeTypeDir, this.rerunnableChangeParser, TrueFileFilter.INSTANCE, schema);
                        } else {
                            changes = findTableChanges(changeType, changeTypeDir, schema, useBaseline);
                        }
                        schemaChanges.withAll(changes);
                    }
                }

                MutableCollection<Change> tableChanges = schemaChanges.select(
                        Predicates.attributeIn(Change.TO_CHANGE_TYPE_NAME, Sets.immutable.of(ChangeType.TABLE_STR, ChangeType.FOREIGN_KEY_STR)));
                MutableMultimap<String, Change> tableChangeMap = tableChanges.groupBy(Change.TO_DB_OBJECT_KEY);

                MutableCollection<Change> staticDataChanges = schemaChanges.select(Predicates.attributeEqual(Change.TO_CHANGE_TYPE_NAME, ChangeType.STATICDATA_STR));

                // now enrich the staticData objects w/ the information from the tables to facilitate the
                // deployment order calculation.
                for (Change staticDataChange : staticDataChanges) {
                    MutableCollection<Change> relatedTableChanges = tableChangeMap.get(staticDataChange.getDbObjectKey());
                    MutableCollection<Change> foreignKeys = relatedTableChanges.select(
                            Predicates.attributeEqual(Change.TO_CHANGE_TYPE_NAME, ChangeType.FOREIGN_KEY_STR));

                    String fkContent = foreignKeys.collect(Change.TO_CONTENT).makeString("\n\n");

                    staticDataChange.setContentForDependencyCalculation(fkContent);
                }


                allChanges.addAll(schemaChanges);
            } else {
                LOG.info("Skipping schema directory [{}] as it was not defined among the schemas in your system-config.xml file: {}", schema, envSchemas);
                continue;
            }
        }
    }

    return allChanges.selectWith(ArtifactRestrictions.apply(), env).toImmutable();
}
 
開發者ID:goldmansachs,項目名稱:obevo,代碼行數:58,代碼來源:DbDirectoryChangesetReader.java


注:本文中的org.eclipse.collections.api.multimap.MutableMultimap類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。