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


Java ListUtils.intersection方法代码示例

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


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

示例1: getAllGroupIds

import org.apache.commons.collections.ListUtils; //导入方法依赖的package包/类
@Override
public GroupIdList getAllGroupIds( List<String> selectedRepos )
    throws ArchivaRestServiceException
{
    List<String> observableRepos = getObservableRepos();
    List<String> repos = ListUtils.intersection( observableRepos, selectedRepos );
    if ( repos == null || repos.isEmpty() )
    {
        return new GroupIdList( Collections.<String>emptyList() );
    }
    try
    {
        return new GroupIdList( new ArrayList<>( repositorySearch.getAllGroupIds( getPrincipal(), repos ) ) );
    }
    catch ( RepositorySearchException e )
    {
        log.error( e.getMessage(), e );
        throw new ArchivaRestServiceException( e.getMessage(), e );
    }

}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:22,代码来源:DefaultSearchService.java

示例2: performCollectionFiltering

import org.apache.commons.collections.ListUtils; //导入方法依赖的package包/类
/**
 * Performs any filtering necessary on the collection before building the collection fields.
 *
 * <p>If showInactive is set to false and the collection line type implements {@code Inactivatable},
 * invokes the active collection filter. Then any {@link CollectionFilter} instances configured for the collection
 * group are invoked to filter the collection. Collections lines must pass all filters in order to be
 * displayed</p>
 *
 * @param view view instance that contains the collection
 * @param model object containing the views data
 * @param collectionGroup collection group component instance that will display the collection
 * @param collection collection instance that will be filtered
 */
protected List<Integer> performCollectionFiltering(View view, Object model, CollectionGroup collectionGroup,
        Collection<?> collection) {
    List<Integer> filteredIndexes = new ArrayList<Integer>();
    for (int i = 0; i < collection.size(); i++) {
        filteredIndexes.add(Integer.valueOf(i));
    }

    if (Inactivatable.class.isAssignableFrom(collectionGroup.getCollectionObjectClass()) && !collectionGroup
            .isShowInactiveLines()) {
        List<Integer> activeIndexes = collectionGroup.getActiveCollectionFilter().filter(view, model,
                collectionGroup);
        filteredIndexes = ListUtils.intersection(filteredIndexes, activeIndexes);
    }

    for (CollectionFilter collectionFilter : collectionGroup.getFilters()) {
        List<Integer> indexes = collectionFilter.filter(view, model, collectionGroup);
        filteredIndexes = ListUtils.intersection(filteredIndexes, indexes);
        if (filteredIndexes.isEmpty()) {
            break;
        }
    }

    return filteredIndexes;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:38,代码来源:CollectionGroupBuilder.java

示例3: getAcceptedDataTypes

import org.apache.commons.collections.ListUtils; //导入方法依赖的package包/类
/** 
 * The accepted data types of a group item is the same as of the underlying base item.
 * If none is defined, the intersection of all sets of accepted data types of all group
 * members is used instead.
 * 
 * @return the accepted data types of this group item
 */
@SuppressWarnings("unchecked")
public List<Class<? extends State>> getAcceptedDataTypes() {
	if(baseItem!=null) {
		return baseItem.getAcceptedDataTypes();
	} else {
		List<Class<? extends State>> acceptedDataTypes = null;
		
		for(Item item : members) {
			if(acceptedDataTypes==null) {
				acceptedDataTypes = item.getAcceptedDataTypes();
			} else {
				acceptedDataTypes = ListUtils.intersection(acceptedDataTypes, item.getAcceptedDataTypes());
			}
		}
		return acceptedDataTypes == null ? ListUtils.EMPTY_LIST : acceptedDataTypes;
	}
}
 
开发者ID:Neulinet,项目名称:Zoo,代码行数:25,代码来源:GroupItem.java

示例4: getAcceptedCommandTypes

import org.apache.commons.collections.ListUtils; //导入方法依赖的package包/类
/** 
 * The accepted command types of a group item is the same as of the underlying base item.
 * If none is defined, the intersection of all sets of accepted command types of all group
 * members is used instead.
 * 
 * @return the accepted command types of this group item
 */
@SuppressWarnings("unchecked")
public List<Class<? extends Command>> getAcceptedCommandTypes() {
	if(baseItem!=null) {
		return baseItem.getAcceptedCommandTypes();
	} else {
		List<Class<? extends Command>> acceptedCommandTypes = null;
		
		for(Item item : members) {
			if(acceptedCommandTypes==null) {
				acceptedCommandTypes = item.getAcceptedCommandTypes();
			} else {
				acceptedCommandTypes = ListUtils.intersection(acceptedCommandTypes, item.getAcceptedCommandTypes());
			}
		}
		return acceptedCommandTypes == null ? ListUtils.EMPTY_LIST : acceptedCommandTypes;
	}
}
 
开发者ID:Neulinet,项目名称:Zoo,代码行数:25,代码来源:GroupItem.java

示例5: getUpdatedAlnsID4AUorEU

import org.apache.commons.collections.ListUtils; //导入方法依赖的package包/类
/**
 * get node evaluated to true with respect to formula (\neg arg1 \land \neg arg2) freshly
 * 
 * @param eu EU sub-formula in the form of E(arg1 U arg2)
 * @param arg1 the first argument of eu sub-formula
 * @param arg2 the second argument of eu sub-formula
 * 
 * @return list of ids of nodes
 */
@SuppressWarnings("unchecked")
private List<String> getUpdatedAlnsID4AUorEU(Composite arg1, Composite arg2)
{
	List<String> falArg1Alns = fal4SubFormula.get(arg1);
	List<String> falNewArg1Alns = falNew4SubFormula.get(arg1);
	List<String> falArg2Alns = fal4SubFormula.get(arg2);
	List<String> falNewArg2Alns = falNew4SubFormula.get(arg2);
	
	List<String> arg1_newArg2 = ListUtils.intersection(falArg1Alns, falNewArg2Alns);
	List<String> arg2_newArg1 = ListUtils.intersection(falNewArg1Alns, falArg2Alns);
	List<String> newArg1_newArg2 = ListUtils.intersection(falNewArg1Alns, falNewArg2Alns);
	
	List<String> arg1_arg2 = ListUtil.union(newArg1_newArg2,ListUtil.union(arg1_newArg2, arg2_newArg1));

	return arg1_arg2;
}
 
开发者ID:alg-nju,项目名称:mipa,代码行数:26,代码来源:CheckerInfo.java

示例6: performCollectionFiltering

import org.apache.commons.collections.ListUtils; //导入方法依赖的package包/类
/**
 * Performs any filtering necessary on the collection before building the collection fields
 *
 * <p>
 * If showInactive is set to false and the collection line type implements {@code Inactivatable},
 * invokes the active collection filter. Then any {@link CollectionFilter} instances configured for the collection
 * group are invoked to filter the collection. Collections lines must pass all filters in order to be
 * displayed
 * </p>
 *
 * @param view view instance that contains the collection
 * @param model object containing the views data
 * @param collectionGroup collection group component instance that will display the collection
 * @param collection collection instance that will be filtered
 */
protected List<Integer> performCollectionFiltering(View view, Object model, CollectionGroup collectionGroup,
        Collection<?> collection) {
    List<Integer> filteredIndexes = new ArrayList<Integer>();
    for (int i = 0; i < collection.size(); i++) {
        filteredIndexes.add(Integer.valueOf(i));
    }

    if (Inactivatable.class.isAssignableFrom(collectionGroup.getCollectionObjectClass()) && !collectionGroup
            .isShowInactiveLines()) {
        List<Integer> activeIndexes = collectionGroup.getActiveCollectionFilter().filter(view, model,
                collectionGroup);
        filteredIndexes = ListUtils.intersection(filteredIndexes, activeIndexes);
    }

    for (CollectionFilter collectionFilter : collectionGroup.getFilters()) {
        List<Integer> indexes = collectionFilter.filter(view, model, collectionGroup);
        filteredIndexes = ListUtils.intersection(filteredIndexes, indexes);
        if (filteredIndexes.isEmpty()) {
            break;
        }
    }

    return filteredIndexes;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:40,代码来源:CollectionGroupBuilder.java

示例7: bestBookUDK

import org.apache.commons.collections.ListUtils; //导入方法依赖的package包/类
public List bestBookUDK(List l,String udk){
   
   Result res;
   Query q=new WildcardQuery(new Term("DC",udk+"*"));
   res = BisisApp.getRecordManager().selectAll3x(SerializationUtils.serialize(q), SerializationUtils.serialize(filter), "TI_sort");
   List resultList = ListUtils.intersection(res.getInvs(),l);
   return resultList;
}
 
开发者ID:unsftn,项目名称:bisis-v4,代码行数:9,代码来源:FilterManager.java

示例8: getReChecked4EUorAU

import org.apache.commons.collections.ListUtils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public List<String> getReChecked4EUorAU(Composite arg1, Composite arg2)
{
	return ListUtils.intersection(CheckerInfo.sat4SubFormula.get(arg1), CheckerInfo.fal4SubFormula.get(arg2));
}
 
开发者ID:alg-nju,项目名称:mipa,代码行数:6,代码来源:CheckerInfo.java


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