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


Java ListUtils.subtract方法代码示例

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


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

示例1: checkAndAdjustRowsColumns

import org.apache.commons.collections.ListUtils; //导入方法依赖的package包/类
/**
 * 
 * @param keyValues
 * @param keyList
 * @param incomingList2 
 */
private void checkAndAdjustRowsColumns(List<HivePartitionFields> keyValues,List<String> keyList, List<InputHivePartitionColumn> incomingList)
{
	Set<String> colNames= new HashSet<>();
	for (int i=0; i < incomingList.size();i++) {
		
		colNames=extractColumnNamesFromObject(incomingList.get(i), colNames);
		 
		List<String> notAvailableFields = ListUtils.subtract(keyList,new ArrayList<>(colNames));   
		
	    if(null!=notAvailableFields&&notAvailableFields.size()>0){
	     for(String fieldName:notAvailableFields){
	    	 
	    	keyValues.get(i).getRowFields().add(keyList.indexOf(fieldName), "");
	     }
		}
	     colNames.clear();
	}

}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:26,代码来源:HiveFieldDialogHelper.java

示例2: okPressed

import org.apache.commons.collections.ListUtils; //导入方法依赖的package包/类
@Override
protected void okPressed() {
	this.excelFormattingDataStructure = new ExcelFormattingDataStructure();
	
	if(StringUtils.isNotBlank(combo.getText())){
		excelFormattingDataStructure.setCopyOfField(combo.getText());
	}
	
	if(!StringUtils.equals(combo.getText(),"Select")){
		if(schemaFields !=null && !schemaFields.isEmpty() && draggedFields !=null && !draggedFields.isEmpty()){
			List remainingFields = ListUtils.subtract(schemaFields, draggedFields);
			excelFormattingDataStructure.setCopyFieldList(remainingFields);
		}
	}else{
		excelFormattingDataStructure.setCopyFieldList(new ArrayList<>());
	}
	
	
	
	if(targetTableViewer.getInput() !=null){
		excelFormattingDataStructure.setListOfExcelConfiguration((List<ExcelConfigurationDataStructure>) targetTableViewer.getInput());
	}
	super.okPressed();
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:25,代码来源:ExcelFormattingDialog.java

示例3: getMembersDiff

import org.apache.commons.collections.ListUtils; //导入方法依赖的package包/类
private MembersDiff getMembersDiff(List<String> oldMemberPrincipalIds, List<String> newMemberPrincipalIds) {

    	// ListUtils does not check the null case.  Which can happen when adding a new group
    	// so, if they're null make them empty lists.
    	if(oldMemberPrincipalIds == null) {
            oldMemberPrincipalIds = new ArrayList<String>();
        }
    	if(newMemberPrincipalIds == null) {
            newMemberPrincipalIds = new ArrayList<String>();
        }

        Set<String> addedPrincipalIds = new HashSet<String>(ListUtils.subtract(newMemberPrincipalIds, oldMemberPrincipalIds));
        Set<String> removedPrincipalIds = new HashSet<String>(ListUtils.subtract(oldMemberPrincipalIds, newMemberPrincipalIds));
        return new MembersDiff(addedPrincipalIds, removedPrincipalIds);
    }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:16,代码来源:GroupInternalServiceImpl.java

示例4: checkForHiddenSingleRow

import org.apache.commons.collections.ListUtils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
   public void checkForHiddenSingleRow(int rowNum, int columnNum,
    List<Integer> permuteList) {

List<Integer> result = new LinkedList<Integer>();

for (int j = 0; j < Constants.BOARDSIZE; j++) {
    if (j == columnNum)
	continue;
    List<Integer> temp = new LinkedList<Integer>();
    if (board[rowNum][j].getCellType() == CellType.VALUE) {
	fillList(temp);
	checkInRow(rowNum, temp);
	checkInColumn(j, temp);
	checkInSubGrid(rowNum, j, temp);
	result = ListUtils.union(result, temp);
    }

}

List<Integer> solution = new LinkedList<Integer>();

solution = ListUtils.subtract(permuteList, result);

if (solution.size() == 1) {
    fillValueXY(rowNum, columnNum, solution.get(0),
	    CellType.PREDETERMINED);
}
   }
 
开发者ID:snjv180,项目名称:CS572,代码行数:30,代码来源:Board.java

示例5: checkForHiddenSingleColumn

import org.apache.commons.collections.ListUtils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
   public void checkForHiddenSingleColumn(int rowNum, int columnNum,
    List<Integer> permuteList) {
List<Integer> result = new LinkedList<Integer>();

for (int i = 0; i < Constants.BOARDSIZE; i++) {
    if (i == rowNum)
	continue;
    List<Integer> temp = new LinkedList<Integer>();
    if (board[i][columnNum].getCellType() == CellType.VALUE) {
	fillList(temp);
	checkInRow(i, temp);
	checkInColumn(columnNum, temp);
	checkInSubGrid(i, columnNum, temp);
	result = ListUtils.union(result, temp);
    }
}

List<Integer> solution = new LinkedList<Integer>();

solution = ListUtils.subtract(permuteList, result);

if (solution.size() == 1) {
    fillValueXY(rowNum, columnNum, solution.get(0),
	    CellType.PREDETERMINED);
}
   }
 
开发者ID:snjv180,项目名称:CS572,代码行数:28,代码来源:Board.java

示例6: heldBy

import org.apache.commons.collections.ListUtils; //导入方法依赖的package包/类
/**
 * @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#heldBy(org.alfresco.service.cmr.repository.NodeRef, boolean)
 */
@SuppressWarnings("unchecked")
@Override
public List<NodeRef> heldBy(NodeRef nodeRef, boolean includedInHold)
{
    ParameterCheck.mandatory("nodeRef", nodeRef);

    List<NodeRef> result = null;

    // get all the immediate parent holds
    Set<NodeRef> holdsNotIncludingNodeRef = getParentHolds(nodeRef);

    // check whether the record is held by vitue of it's record folder
    if (isRecord(nodeRef))
    {
        List<NodeRef> recordFolders = recordFolderService.getRecordFolders(nodeRef);
        for (NodeRef recordFolder : recordFolders)
        {
            holdsNotIncludingNodeRef.addAll(getParentHolds(recordFolder));
        }
    }

    if (!includedInHold)
    {
        // invert list to get list of holds that do not contain this node
        NodeRef filePlan = filePlanService.getFilePlan(nodeRef);
        List<NodeRef> allHolds = getHolds(filePlan);
        result = ListUtils.subtract(allHolds, new ArrayList<NodeRef>(holdsNotIncludingNodeRef));
    }
    else
    {
        result = new ArrayList<NodeRef>(holdsNotIncludingNodeRef);
    }

    return result;
}
 
开发者ID:Alfresco,项目名称:records-management-old,代码行数:39,代码来源:HoldServiceImpl.java

示例7: getMembersDiff

import org.apache.commons.collections.ListUtils; //导入方法依赖的package包/类
private MembersDiff getMembersDiff(List<String> oldMemberPrincipalIds, List<String> newMemberPrincipalIds) {

    	// ListUtils does not check the null case.  Which can happen when adding a new group
    	// so, if they're null make them empty lists.
    	if(oldMemberPrincipalIds == null) oldMemberPrincipalIds = new ArrayList<String>();
    	if(newMemberPrincipalIds == null) newMemberPrincipalIds = new ArrayList<String>();

        Set<String> addedPrincipalIds = new HashSet<String>(ListUtils.subtract(newMemberPrincipalIds, oldMemberPrincipalIds));
        Set<String> removedPrincipalIds = new HashSet<String>(ListUtils.subtract(oldMemberPrincipalIds, newMemberPrincipalIds));
        return new MembersDiff(addedPrincipalIds, removedPrincipalIds);
    }
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:12,代码来源:GroupInternalServiceImpl.java

示例8: validateInvalidHeaders

import org.apache.commons.collections.ListUtils; //导入方法依赖的package包/类
private void validateInvalidHeaders(List<String> headers) {
  List<String> fieldNames = getAllImportedFieldNames();
  List invalidHeaders = ListUtils.subtract(headers, lowerCase(fieldNames));
  if (!invalidHeaders.isEmpty()) {
    throw new UploadException("error.upload.invalid.header", invalidHeaders.toString());
  }
}
 
开发者ID:mkhanal,项目名称:quickocm,代码行数:8,代码来源:ModelClass.java

示例9: getPastedFileList

import org.apache.commons.collections.ListUtils; //导入方法依赖的package包/类
private List<IFile> getPastedFileList(List<IFile> jobFiles) {
	List<IFile> newJobFilesList = ListUtils.subtract(jobFiles, JobCopyParticipant.getPreviousJobFiles());
	jobFiles.clear();
	jobFiles.addAll(newJobFilesList);
	return jobFiles;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:7,代码来源:PasteHandler.java

示例10: checkIfNewColumnAddedOrDeleted

import org.apache.commons.collections.ListUtils; //导入方法依赖的package包/类
/**
 * 
 * @param columnNames
 * @param keyList
 * @return
 */
private List<String> checkIfNewColumnAddedOrDeleted(List<String> columnNames,List<String> keyList) {
	
	if(null!=columnNames&&!columnNames.isEmpty()&&!keyList.isEmpty()){
	
	return ListUtils.subtract(keyList, columnNames);
	
	}
	
	return new ArrayList<String>();

}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:18,代码来源:HiveFieldDialogHelper.java


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