本文整理匯總了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&¬AvailableFields.size()>0){
for(String fieldName:notAvailableFields){
keyValues.get(i).getRowFields().add(keyList.indexOf(fieldName), "");
}
}
colNames.clear();
}
}
示例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();
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
示例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());
}
}
示例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;
}
示例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>();
}