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


Java IteratorUtils.filteredIterator方法代码示例

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


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

示例1: getBaseValidCases

import org.apache.commons.collections4.IteratorUtils; //导入方法依赖的package包/类
/**
 * Returns a set of valid {@link TestCaseDef test case definitions} that extend the given base test cases.
 */
private List<TestCaseDef> getBaseValidCases( FunctionInputDef inputDef, VarTupleSet validTuples, List<TestCaseDef> baseCases)
  {
  logger_.debug( "{}: Extending valid base test cases", inputDef);

  Iterator<TestCaseDef> validBaseCases =
    IteratorUtils.filteredIterator
    ( baseCases.iterator(),
      new Predicate<TestCaseDef>()
        {
        public boolean evaluate( TestCaseDef testCase)
          {
          return testCase.getInvalidVar() == null;
          }
        });

  List<TestCaseDef> testCases = extendBaseCases( inputDef, validTuples, validBaseCases);

  logger_.info( "{}: Extended {} valid base test cases", inputDef, testCases.size());
  return testCases;
 }
 
开发者ID:Cornutum,项目名称:tcases,代码行数:24,代码来源:TupleGenerator.java

示例2: call

import org.apache.commons.collections4.IteratorUtils; //导入方法依赖的package包/类
@Override
public Void call() throws GitAPIException {
	checkCallable();

	List<Ref> refs = gitRepository.getRefs(Ref.class);

	List<Predicate<ReflogEntry>> refLogEntryFilterPredicates = new ArrayList<Predicate<ReflogEntry>>();

	refLogEntryFilterPredicates.add(expireDatePredicate);
	refLogEntryFilterPredicates.add(new ReflogEntryFilterPredicateAdapter(
			reflogEntryFilter));

	Predicate<ReflogEntry> refLogEntriesFilter = AllPredicate
			.allPredicate(refLogEntryFilterPredicates);

	try {
		for (Ref ref : refs) {
			List<ReflogEntry> reflogEntries = ref.getReflogEntries();

			Iterator<ReflogEntry> reflogEntryIterator = reflogEntries
					.iterator();
			Iterator<ReflogEntry> filteredReflogEntryIterator = IteratorUtils
					.filteredIterator(reflogEntryIterator,
							refLogEntriesFilter);
			List<ReflogEntry> nonFilteredReflogEntries = IteratorUtils
					.toList(filteredReflogEntryIterator);

			ref.clearReflog();
			ref.addReflogEntries(nonFilteredReflogEntries);
		}
	} catch (IOException e) {
		throw new GitAPIException("Unable to read reflog entries", e) {

			private static final long serialVersionUID = 2266798959465371684L;
		};
	}

	return null;
}
 
开发者ID:link-intersystems,项目名称:GitDirStat,代码行数:40,代码来源:ExpireReflogCommand.java

示例3: getBinds

import org.apache.commons.collections4.IteratorUtils; //导入方法依赖的package包/类
/**
 * Returns input tuples that bind the given variable.
 */
private Iterator<Tuple> getBinds( Iterator<Tuple> tuples, final VarDef var)
  {
  return
    IteratorUtils.filteredIterator
    ( tuples,
      new Predicate<Tuple>()
        {
        public boolean evaluate( Tuple tuple)
          {
          return tuple.getBinding( var) != null;
          }
        });
  }
 
开发者ID:Cornutum,项目名称:tcases,代码行数:17,代码来源:VarTupleSet.java

示例4: getVarBindings

import org.apache.commons.collections4.IteratorUtils; //导入方法依赖的package包/类
/**
 * Returns the bindings for variables of the given type for this function.
 */
public Iterator<VarBinding> getVarBindings( final String type)
  {
  return
    IteratorUtils.filteredIterator
    ( varBindings_.iterator(),
      new Predicate<VarBinding>()
      {
      @SuppressWarnings("deprecation")
      public boolean evaluate( VarBinding binding)
        {
        return ObjectUtils.equals( binding.getType(), type);
        }
      });
  }
 
开发者ID:Cornutum,项目名称:tcases,代码行数:18,代码来源:TestCase.java

示例5: getValidValues

import org.apache.commons.collections4.IteratorUtils; //导入方法依赖的package包/类
/**
 * Returns an iterator for the set of valid values.
 */
public Iterator<VarValueDef> getValidValues()
  {
  return
    IteratorUtils.filteredIterator
    ( getValues(),
      new Predicate<VarValueDef>()
        {
        public boolean evaluate( VarValueDef valueDef)
          {
          return valueDef.isValid();
          }
        });
  }
 
开发者ID:Cornutum,项目名称:tcases,代码行数:17,代码来源:VarDef.java

示例6: getFailureValues

import org.apache.commons.collections4.IteratorUtils; //导入方法依赖的package包/类
/**
 * Returns an iterator for the set of failure values.
 */
public Iterator<VarValueDef> getFailureValues()
  {
  return
    IteratorUtils.filteredIterator
    ( getValues(),
      new Predicate<VarValueDef>()
        {
        public boolean evaluate( VarValueDef valueDef)
          {
          return !valueDef.isValid();
          }
        });
  }
 
开发者ID:Cornutum,项目名称:tcases,代码行数:17,代码来源:VarDef.java

示例7: writeInputs

import org.apache.commons.collections4.IteratorUtils; //导入方法依赖的package包/类
/**
 * Writes the input value definitions for all variables of the given type.
 */
protected void writeInputs( TestCase testCase, String type)
  {
  Iterator<VarBinding> varBindings =
    IteratorUtils.filteredIterator
      ( testCase.getVarBindings( type),
        new Predicate<VarBinding>()
           {
           public boolean evaluate( VarBinding binding)
              {
              return !binding.isValueNA();
              }
          });

  if( varBindings.hasNext())
    {
    xmlWriter_.writeTagStart( "DIV");
    xmlWriter_.writeAttribute( "class", "input " + type);
    xmlWriter_.writeTagEnd();
    xmlWriter_.indent();

    if( !IVarDef.ARG.equals( type))
      {
      xmlWriter_.writeElement( "H3", type);
      }
  
    writeVarSets( 0, varBindings);
  
    xmlWriter_.unindent();
    xmlWriter_.writeElementEnd( "DIV");
    }
  }
 
开发者ID:Cornutum,项目名称:tcases,代码行数:35,代码来源:SystemTestHtmlWriter.java

示例8: instances

import org.apache.commons.collections4.IteratorUtils; //导入方法依赖的package包/类
@SuppressWarnings({ CompilerWarnings.UNCHECKED })
public static <T, U> FilterIterator<U> instances(Iterator<T> iterator, Class<U> clazz) {
    return ((FilterIterator<U>) IteratorUtils.filteredIterator(iterator, PredicateUtils.instanceofPredicate(clazz)));
}
 
开发者ID:esacinc,项目名称:crigtt,代码行数:5,代码来源:CrigttIteratorUtils.java


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