当前位置: 首页>>代码示例>>Java>>正文


Java LambdaList类代码示例

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


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

示例1: checkSubFile

import ch.lambdaj.collection.LambdaList; //导入依赖的package包/类
private boolean checkSubFile(CovariateFile knownCovariate, JsonCovariateFile configCovariate) {
    List<CovariateSubFile> knownCovariateSubFiles = knownCovariate.getFiles();
    List<JsonCovariateSubFile> configCovariateSubFiles = configCovariate.getSubFiles();

    // The IDs of the sub files for this covariate must match the ones in the db
    LambdaList<Integer> knownSubFileIds = with(knownCovariateSubFiles)
            .extract(on(CovariateSubFile.class).getId());
    LambdaList<Integer> configSubFileIds = with(configCovariateSubFiles)
            .extract(on(JsonCovariateSubFile.class).getId());

    if (!knownSubFileIds.equals(configSubFileIds)) {
        return false;
    }

    // The file paths of the sub files for this covariate must match the ones in the db
    LambdaList<String> knownSubFilePaths = with(knownCovariateSubFiles)
            .extract(on(CovariateSubFile.class).getFile());
    LambdaList<String> configSubFilePaths = with(configCovariateSubFiles)
            .extract(on(JsonCovariateSubFile.class).getPath());

    if (!knownSubFilePaths.equals(configSubFilePaths)) {
        return false;
    }

    return true;
}
 
开发者ID:SEEG-Oxford,项目名称:ABRAID-MP,代码行数:27,代码来源:CovariatesControllerValidator.java

示例2: toList

import ch.lambdaj.collection.LambdaList; //导入依赖的package包/类
@Coercion
public LambdaList<Integer> toList(String input) {
	String[] numbers = input.replace("[", "").replace("]", "").split(",");
	
	return with(numbers).convert(new Converter<String, Integer>() {
		
		public Integer convert(String from) {
			return Integer.parseInt(from.trim());
		}
	});
}
 
开发者ID:piotrturski,项目名称:zohhak,代码行数:12,代码来源:CollectionsCoercionTest.java

示例3: matchesSafely

import ch.lambdaj.collection.LambdaList; //导入依赖的package包/类
@Override
protected boolean matchesSafely(List<? extends T> actual, Description mismatchDescription) {
    LambdaList<Wrapper<T>> wrappedActual = with(actual).convert(wrap(actual, wrapperFactory));
    LambdaList<Wrapper<T>> wrappedExpected = with(expected).convert(wrap(expected, wrapperFactory));

    LambdaList<Wrapper<T>> inActualButNotInExpected = wrappedActual.clone().remove(isIn(wrappedExpected));
    LambdaList<Wrapper<T>> inExpectedButNotInActual = wrappedExpected.clone().remove(isIn(wrappedActual));

    appendMismatch(mismatchDescription, "In Actual but not in Expected", inActualButNotInExpected);
    appendMismatch(mismatchDescription, "In Expected but not in Actual", inExpectedButNotInActual);

    Matcher<Collection<? extends Wrapper<T>>> collectionMatcher = hasSameItemsAsCollection(
            wrappedExpected.remove(not(isIn(wrappedActual)))
    );
    collectionMatcher.describeMismatch(wrappedActual.remove(not(isIn(wrappedExpected))), mismatchDescription);

    int notsorted = 0;
    if (sortcheck) {
        LambdaList<Wrapper<T>> notCorrectlySorted = wrappedExpected.clone()
                .remove(sortedEqual(wrappedActual));
        appendMismatch(mismatchDescription, "Not sorted correctly",
                notCorrectlySorted.convert(MismatchHelper.asStringWithFind(wrappedActual)).distinct());
        notsorted = notCorrectlySorted.size();
    }

    return inActualButNotInExpected.size()
            + inExpectedButNotInActual.size()
            + notsorted == 0 && collectionMatcher.matches(wrappedActual);
}
 
开发者ID:yandex-qatools,项目名称:matchers-java,代码行数:30,代码来源:HasSameItemsAsListMatcher.java


注:本文中的ch.lambdaj.collection.LambdaList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。