Java 类org.apache.commons.collections.iterators.UnmodifiableIterator 实例源码

项目:HBase-Research    文件:CompoundConfiguration.java   
@Override
public Iterator<Map.Entry<String, String>> iterator() {
  Map<String, String> ret = new HashMap<String, String>();

  // add in reverse order so that oldest get overridden.
  if (!configs.isEmpty()) {
    for (int i = configs.size() - 1; i >= 0; i--) {
      ImmutableConfigMap map = configs.get(i);
      Iterator<Map.Entry<String, String>> iter = map.iterator();
      while (iter.hasNext()) {
        Map.Entry<String, String> entry = iter.next();
        ret.put(entry.getKey(), entry.getValue());
      }
    }
  }

  return UnmodifiableIterator.decorate(ret.entrySet().iterator());
}
项目:terminal-recall    文件:PredicatedORCollectionActionFilter.java   
@Override
   public Iterator<Predicate<E>> iterator() {
final ArrayList<Predicate> pCopy = new ArrayList<Predicate>(predicates);
return UnmodifiableIterator.decorate(pCopy.iterator());
   }
项目:terminal-recall    文件:PredicatedORCollectionActionFilter.java   
@Override
public Iterator<E> iterator() {
    return UnmodifiableIterator.decorate(new IteratorChain(Arrays.asList(used.iterator(),unused.iterator())));
}