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


Java ListUtils.unmodifiableList方法代码示例

本文整理汇总了Java中org.apache.commons.collections4.ListUtils.unmodifiableList方法的典型用法代码示例。如果您正苦于以下问题:Java ListUtils.unmodifiableList方法的具体用法?Java ListUtils.unmodifiableList怎么用?Java ListUtils.unmodifiableList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.collections4.ListUtils的用法示例。


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

示例1: subList

import org.apache.commons.collections4.ListUtils; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 * <p>
 * NOTE: from 4.0, an unmodifiable list will be returned, as changes to the
 * subList can invalidate the parent list.
 */
@Override
public List<E> subList(final int fromIndex, final int toIndex) {
    final List<E> superSubList = super.subList(fromIndex, toIndex);
    final Set<E> subSet = createSetBasedOnList(set, superSubList);
    return ListUtils.unmodifiableList(new SetUniqueList<E>(superSubList, subSet));
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:13,代码来源:SetUniqueList.java

示例2: getDomains

import org.apache.commons.collections4.ListUtils; //导入方法依赖的package包/类
public List<String> getDomains() {
    synchronized (LOG) {
        if (domains == null) {
            domains = newClientFactory().create(
                    new AnonymousAuthenticationHandler(anonymousUser, anonymousKey)).
                    getService(DomainService.class).list().stream().map(EntityTO::getKey).
                    collect(Collectors.toList());
            domains.add(0, SyncopeConstants.MASTER_DOMAIN);
            domains = ListUtils.unmodifiableList(domains);
        }
    }
    return domains;
}
 
开发者ID:apache,项目名称:syncope,代码行数:14,代码来源:SyncopeConsoleApplication.java

示例3: findPredicateWord

import org.apache.commons.collections4.ListUtils; //导入方法依赖的package包/类
/**
 * Find a word whose prefixes (including the word) conform to a given predicate and which itself also conforms
 * to a second predicate.
 *
 * This method uses a depth-first search. A breath-first search would use more memory.
 *
 * @param a The automaton whose accepted words should get checked.
 * @param prefixPredicate The predicate to check the prefixes.
 * @param wordPredicate The predicate to check the words.
 * @return A word which conforms to the predicates.
 */
static public List<String> findPredicateWord(FiniteAutomaton a, Predicate<List<String>> prefixPredicate,
		Predicate<List<String>> wordPredicate) {
	MinimalDeterministicFiniteAutomaton dfa = minimizeInternal(a);
	Deque<Pair<DFAState, Iterator<Symbol>>> trace = new ArrayDeque<>();
	LinkedList<String> word = new LinkedList<>();
	DFAState initial   = dfa.getInitialState();
	DFAState sinkState = findSinkState(dfa);
	trace.add(new Pair<>(initial, initial.getDefinedSymbols().iterator()));

	while (!trace.isEmpty()) {
		Pair<DFAState, Iterator<Symbol>> pair = trace.peekLast();
		if (!pair.getSecond().hasNext()) {
			trace.removeLast();
			word.pollLast();
		} else {
			Symbol symbol = pair.getSecond().next();
			DFAState nextState = pair.getFirst().getFollowingState(symbol);
			if (!nextState.equals(sinkState)) {
				word.add(symbol.getEvent());

				List<String> roWord = ListUtils.unmodifiableList(word);

				if (prefixPredicate.evaluate(roWord)) {
					trace.addLast(new Pair<>(nextState,
								nextState.getDefinedSymbols().iterator()));

					if (nextState.isFinalState() && wordPredicate.evaluate(roWord))
						return word;
				} else {
					word.removeLast();
				}
			}
		}
	}

	return null;
}
 
开发者ID:CvO-Theory,项目名称:apt,代码行数:49,代码来源:FiniteAutomatonUtility.java

示例4: getNullRunnables

import org.apache.commons.collections4.ListUtils; //导入方法依赖的package包/类
@Override
   public List<Runnable> getNullRunnables() {
return ListUtils.unmodifiableList(nullRunnables);
   }
 
开发者ID:jtrfp,项目名称:terminal-recall,代码行数:5,代码来源:DefaultKeyedExecutor.java


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