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


Java IteratorUtils.transformedIterator方法代码示例

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


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

示例1: createUniqueSetIterator

import org.apache.commons.collections4.IteratorUtils; //导入方法依赖的package包/类
/**
 * Creates a unique set iterator.
 * Subclasses can override this to return iterators with different properties.
 *
 * @return the uniqueSet iterator
 */
protected Iterator<E> createUniqueSetIterator() {
    final Transformer<Entry<E>, E> transformer = new Transformer<Entry<E>, E>() {
        @Override
        public E transform(Entry<E> entry) {
            return entry.getElement();
        }
    };
    return IteratorUtils.transformedIterator(entrySet().iterator(), transformer);
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:16,代码来源:AbstractMultiSet.java

示例2: createEntrySetIterator

import org.apache.commons.collections4.IteratorUtils; //导入方法依赖的package包/类
@Override
protected Iterator<MultiSet.Entry<K>> createEntrySetIterator() {
    final MapEntryTransformer transformer = new MapEntryTransformer();
    return IteratorUtils.transformedIterator(map.entrySet().iterator(), transformer);
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:6,代码来源:AbstractMultiValuedMap.java

示例3: getSatisfyingTuples

import org.apache.commons.collections4.IteratorUtils; //导入方法依赖的package包/类
/**
 * Returns the set of tuples that could satisfy conditions required by the given test case.
 */
private Iterator<Tuple> getSatisfyingTuples( final TestCaseDef testCase, VarTupleSet varTupleSet)
  {
  final Comparator<VarBindingDef> byUsage = byUsage( varTupleSet);

  return
    IteratorUtils.transformedIterator
    ( // Iterate over all combinations of bindings...
      new CartesianProduct<VarBindingDef>
      ( // ...combining members from all sets...
        new ArrayList<Set<VarBindingDef>>
        ( CollectionUtils.collect
         
          ( // ...where each set of bindings is derived from a disjunct of unsatisfied test case conditions....
            testCase.getRequired().getDisjuncts(),

            // ...and contains the set of compatible bindings that could satisfy this disjunct...
            new Transformer<IDisjunct,Set<VarBindingDef>>()
              {
              public Set<VarBindingDef> transform( IDisjunct disjunct)
                {
                return
                  CollectionUtils.collect
                  ( filtered
                    ( getPropertyProviders
                      ( CollectionUtils.collect
                        ( disjunct.getAssertions(),
                          new Transformer<IAssertion,String>()
                            {
                            public String transform( IAssertion assertion)
                              {
                              return assertion.getProperty();
                              }
                            },
                          new HashSet<String>())),
                      
                      testCase.getBindingCompatible()),

                    sameBinding_,

                    new TreeSet<VarBindingDef>( byUsage));
                }
            },
            // For repeatable combinations, ensure set members have a well-defined order.
            new TreeSet<Set<VarBindingDef>>( varBindingSetSorter_))),
        
        // ...ignoring any infeasible combinations...
        isFeasibleTuple_),
      
       // ... forming each combination of satisfying bindings into a tuple...
      new Transformer<List<VarBindingDef>,Tuple>()
        {
        public Tuple transform( List<VarBindingDef> bindings)
          {
          return Tuple.of( bindings);
          }
        });
  }
 
开发者ID:Cornutum,项目名称:tcases,代码行数:61,代码来源:TupleGenerator.java

示例4: iterator

import org.apache.commons.collections4.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<O> iterator() {
  return IteratorUtils.transformedIterator(source.iterator(), transformer);
}
 
开发者ID:ontopia,项目名称:ontopia,代码行数:5,代码来源:IdentifierIndex.java


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