• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java MutableBag类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.eclipse.collections.api.bag.MutableBag的典型用法代码示例。如果您正苦于以下问题:Java MutableBag类的具体用法?Java MutableBag怎么用?Java MutableBag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

MutableBag类属于org.eclipse.collections.api.bag包,在下文中一共展示了MutableBag类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: logChangeset

点赞 3

import org.eclipse.collections.api.bag.MutableBag; //导入依赖的package包/类
private void logChangeset(Changeset changeset) {
    deployMetricsCollector.addMetric("changeset.executeCount", changeset.getInserts().size());
    deployMetricsCollector.addMetric("changeset.auditCount", changeset.getAuditChanges().size());
    deployMetricsCollector.addMetric("changeset.warningCount", changeset.getChangeWarnings().size());
    deployMetricsCollector.addMetric("changeset.deferredCount", changeset.getDeferredChanges().size());

    MutableBag<String> warningBag = changeset.getChangeWarnings().collect(new Function<ChangeCommandWarning, String>() {
        @Override
        public String valueOf(ChangeCommandWarning warning) {
            return warning.getClass().getName();
        }
    }).toBag();
    warningBag.toMapOfItemToCount().forEachKeyValue(new Procedure2<String, Integer>() {
        @Override
        public void value(String warningClassName, Integer count) {
            deployMetricsCollector.addMetric("changeset.warningTypeCounts." + warningClassName, count);
        }
    });
}
 

开发者ID:goldmansachs,
项目名称:obevo,
代码行数:20,
代码来源:MainDeployer.java

示例2: validateStructureNew

点赞 2

import org.eclipse.collections.api.bag.MutableBag; //导入依赖的package包/类
@Override
protected void validateStructureNew(TextMarkupDocument doc) {
    String allowedSectionString = Sets.immutable.with(TextMarkupDocumentReader.TAG_METADATA, TextMarkupDocumentReader.TAG_BODY, TextMarkupDocumentReader.TAG_DROP_COMMAND).collect(StringFunctions.prepend("//// ")).makeString(", ");

    ImmutableList<TextMarkupDocumentSection> docSections = doc.getSections();
    if (docSections.isEmpty()) {
        throw new IllegalArgumentException("No content defined");
    }

    ImmutableList<TextMarkupDocumentSection> disallowedSections = docSections.reject(Predicates.attributeIn(TextMarkupDocumentSection.TO_NAME, Sets.immutable.with(null, TextMarkupDocumentReader.TAG_METADATA, TextMarkupDocumentReader.TAG_DROP_COMMAND, TextMarkupDocumentReader.TAG_BODY)));
    if (disallowedSections.notEmpty()) {
        throw new IllegalArgumentException("Only allowed 1 content section and at most 1 of these [" + allowedSectionString + "]; instead, found these disallowed sections: " + disallowedSections);
    }

    ImmutableList<String> sectionNames = docSections.collect(TextMarkupDocumentSection.TO_NAME);
    MutableBag<String> duplicateSections = sectionNames.toBag().selectByOccurrences(IntPredicates.greaterThan(1));
    if (duplicateSections.notEmpty()) {
        throw new IllegalArgumentException("Only allowed 1 content section and at most 1 of these [" + allowedSectionString + "]; instead, found these extra sections instances: " + duplicateSections.toSet());
    }

    int metadataIndex = sectionNames.indexOf(TextMarkupDocumentReader.TAG_METADATA);
    int contentIndex = sectionNames.indexOf(null);
    int dropIndexIndex = sectionNames.indexOf(TextMarkupDocumentReader.TAG_DROP_COMMAND);

    if (metadataIndex != -1 && contentIndex != -1 && metadataIndex > contentIndex) {
        throw new IllegalArgumentException("Improper section ordering: " + TextMarkupDocumentReader.TAG_METADATA + " section must come before the content section");
    } else if (contentIndex != -1 && dropIndexIndex != -1 && contentIndex > dropIndexIndex) {
        throw new IllegalArgumentException("Improper section ordering: content section must come before the " + TextMarkupDocumentReader.TAG_DROP_COMMAND + " section");
    }

}
 

开发者ID:goldmansachs,
项目名称:obevo,
代码行数:32,
代码来源:RerunnableChangeParser.java

示例3: logChangeMetrics

点赞 2

import org.eclipse.collections.api.bag.MutableBag; //导入依赖的package包/类
private void logChangeMetrics(final String changeSide, ImmutableList<Change> changes) {
    MutableBag<String> changeTypeCounts = changes.collect(Change.TO_CHANGE_TYPE_NAME).toBag();
    changeTypeCounts.toMapOfItemToCount().forEachKeyValue(new Procedure2<String, Integer>() {
        @Override
        public void value(String changeType, Integer count) {
            deployMetricsCollector.addMetric("changes." + changeSide + "." + changeType, count);
        }
    });
}
 

开发者ID:goldmansachs,
项目名称:obevo,
代码行数:10,
代码来源:MainInputReader.java

示例4: getMutableRawMismatchesQ2

点赞 2

import org.eclipse.collections.api.bag.MutableBag; //导入依赖的package包/类
@Override
@SuppressWarnings("null")
public @NonNull MutableBag<ComparablePair<String, String>> getMutableRawMismatchesQ2() {
	if (rawMismatchesQ2 == null) {
		rawMismatchesQ2 = Bags.mutable.empty();
	}
	return rawMismatchesQ2;
}
 

开发者ID:cinquin,
项目名称:mutinack,
代码行数:9,
代码来源:CandidateSequence.java

示例5: getMutableRawDeletionsQ2

点赞 2

import org.eclipse.collections.api.bag.MutableBag; //导入依赖的package包/类
@Override
@SuppressWarnings("null")
public @NonNull MutableBag<ComparablePair<String, String>> getMutableRawDeletionsQ2() {
	if (rawDeletionsQ2 == null) {
		rawDeletionsQ2 = Bags.mutable.empty();
	}
	return rawDeletionsQ2;
}
 

开发者ID:cinquin,
项目名称:mutinack,
代码行数:9,
代码来源:CandidateSequence.java

示例6: getMutableRawInsertionsQ2

点赞 2

import org.eclipse.collections.api.bag.MutableBag; //导入依赖的package包/类
@Override
@SuppressWarnings("null")
public @NonNull MutableBag<ComparablePair<String, String>> getMutableRawInsertionsQ2() {
	if (rawInsertionsQ2 == null) {
		rawInsertionsQ2 = Bags.mutable.empty();
	}
	return rawInsertionsQ2;
}
 

开发者ID:cinquin,
项目名称:mutinack,
代码行数:9,
代码来源:CandidateSequence.java

示例7: getPetTypes

点赞 2

import org.eclipse.collections.api.bag.MutableBag; //导入依赖的package包/类
public MutableBag<PetType> getPetTypes()
{
    return this.pets.collect(Pet::getType, HashBag.newBag());
}
 

开发者ID:eclipse,
项目名称:eclipse-collections-kata,
代码行数:5,
代码来源:Person.java

示例8: getMutableRawMismatchesQ2

点赞 1

import org.eclipse.collections.api.bag.MutableBag; //导入依赖的package包/类
@NonNull MutableBag<ComparablePair<String, String>> getMutableRawMismatchesQ2(); 

开发者ID:cinquin,
项目名称:mutinack,
代码行数:2,
代码来源:CandidateSequenceI.java

示例9: getMutableRawDeletionsQ2

点赞 1

import org.eclipse.collections.api.bag.MutableBag; //导入依赖的package包/类
MutableBag<ComparablePair<String, String>> getMutableRawDeletionsQ2(); 

开发者ID:cinquin,
项目名称:mutinack,
代码行数:2,
代码来源:CandidateSequenceI.java

示例10: getMutableRawInsertionsQ2

点赞 1

import org.eclipse.collections.api.bag.MutableBag; //导入依赖的package包/类
MutableBag<ComparablePair<String, String>> getMutableRawInsertionsQ2(); 

开发者ID:cinquin,
项目名称:mutinack,
代码行数:2,
代码来源:CandidateSequenceI.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)