當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。