Package org.apache.commons.collections.iterators

Examples of org.apache.commons.collections.iterators.TransformIterator


   {
      final Map<String, NodeData> aggregateRoots = new HashMap<String, NodeData>();
      final Set<String> removedNodeIds = new HashSet<String>();
      final Set<String> addedNodeIds = new HashSet<String>();

      Collection<String> docIdsToRemove = IteratorUtils.toList(new TransformIterator(remove, new Transformer()
      {
         public Object transform(Object input)
         {
            String uuid = ((String)input);
            removedNodeIds.add(uuid);
            return uuid;
         }
      }));
      Collection<Document> docsToAdd = IteratorUtils.toList(new TransformIterator(add, new Transformer()
      {
         public Object transform(Object input)
         {
            NodeData state = (NodeData)input;
            if (state == null)
View Full Code Here


      checkOpen();
      final Map<String, NodeData> aggregateRoots = new HashMap<String, NodeData>();
      final Set<String> removedNodeIds = new HashSet<String>();
      final Set<String> addedNodeIds = new HashSet<String>();

      index.update(IteratorUtils.toList(new TransformIterator(remove, new Transformer()
      {
         public Object transform(Object input)
         {
            String uuid = ((String)input);
            removedNodeIds.add(uuid);
            return uuid;
         }
      })), IteratorUtils.toList(new TransformIterator(add, new Transformer()
      {
         public Object transform(Object input)
         {
            NodeData state = (NodeData)input;
            if (state == null)
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  private Iterator<UIComponent> filteredFacets(Predicate predicate) {
    FilterIterator fixed= new FilterIterator(getFacets().keySet().iterator(),predicate);
   
    return new TransformIterator(fixed,new FacetTransformer());
  }
View Full Code Here

   * @return
   */
  private Iterator filteredFacets(Predicate predicate) {
    FilterIterator fixed= new FilterIterator(getFacets().keySet().iterator(),predicate);
   
    return new TransformIterator(fixed,new FacetTransformer());
  }
View Full Code Here

   {
      final Map<String, NodeData> aggregateRoots = new HashMap<String, NodeData>();
      final Set<String> removedNodeIds = new HashSet<String>();
      final Set<String> addedNodeIds = new HashSet<String>();

      Collection<String> docIdsToRemove = IteratorUtils.toList(new TransformIterator(remove, new Transformer()
      {
         public Object transform(Object input)
         {
            String uuid = ((String)input);
            removedNodeIds.add(uuid);
            return uuid;
         }
      }));
      Collection<Document> docsToAdd = IteratorUtils.toList(new TransformIterator(add, new Transformer()
      {
         public Object transform(Object input)
         {
            NodeData state = (NodeData)input;
            if (state == null)
View Full Code Here

/* 616 */       throw new NullPointerException("Iterator must not be null");
/*     */     }
/* 618 */     if (transform == null) {
/* 619 */       throw new NullPointerException("Transformer must not be null");
/*     */     }
/* 621 */     return new TransformIterator(iterator, transform);
/*     */   }
View Full Code Here

      checkOpen();
      final Map<String, NodeData> aggregateRoots = new HashMap<String, NodeData>();
      final Set<String> removedNodeIds = new HashSet<String>();
      final Set<String> addedNodeIds = new HashSet<String>();

      index.update(IteratorUtils.toList(new TransformIterator(remove, new Transformer()
      {
         public Object transform(Object input)
         {
            String uuid = ((String)input);
            removedNodeIds.add(uuid);
            return uuid;
         }
      })), IteratorUtils.toList(new TransformIterator(add, new Transformer()
      {
         public Object transform(Object input)
         {
            NodeData state = (NodeData)input;
            if (state == null)
View Full Code Here

   {
      final Map<String, NodeData> aggregateRoots = new HashMap<String, NodeData>();
      final Set<String> removedNodeIds = new HashSet<String>();
      final Set<String> addedNodeIds = new HashSet<String>();

      Collection<String> docIdsToRemove = IteratorUtils.toList(new TransformIterator(remove, new Transformer()
      {
         public Object transform(Object input)
         {
            String uuid = ((String)input);
            removedNodeIds.add(uuid);
            return uuid;
         }
      }));
      Collection<Document> docsToAdd = IteratorUtils.toList(new TransformIterator(add, new Transformer()
      {
         public Object transform(Object input)
         {
            NodeData state = (NodeData)input;
            if (state == null)
View Full Code Here

   {
      final Map<String, NodeData> aggregateRoots = new HashMap<String, NodeData>();
      final Set<String> removedNodeIds = new HashSet<String>();
      final Set<String> addedNodeIds = new HashSet<String>();

      Collection<String> docIdsToRemove = IteratorUtils.toList(new TransformIterator(remove, new Transformer()
      {
         public Object transform(Object input)
         {
            String uuid = ((String)input);
            removedNodeIds.add(uuid);
            return uuid;
         }
      }));
      Collection<Document> docsToAdd = IteratorUtils.toList(new TransformIterator(add, new Transformer()
      {
         public Object transform(Object input)
         {
            NodeData state = (NodeData)input;
            if (state == null)
View Full Code Here

        checkOpen();
        final Map aggregateRoots = new HashMap();
        final HashSet removedUUIDs = new HashSet();
        final Set addedUUIDs = new HashSet();

        index.update(IteratorUtils.toList(new TransformIterator(remove,
                new Transformer() {
                    public Object transform(Object input) {
                        UUID uuid = ((NodeId) input).getUUID();
                        removedUUIDs.add(uuid);
                        return uuid;
                    }
                })), IteratorUtils.toList(new TransformIterator(add,
                new Transformer() {
                    public Object transform(Object input) {
                        NodeState state = (NodeState) input;
                        if (state == null) {
                            return null;
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.iterators.TransformIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.