Package org.apache.commons.collections.iterators

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


            public Object transform(Object input) {
                return ((DataMap) input).getName();
            }
        };
        return new TransformIterator(maps.iterator(), tr);
    }
View Full Code Here


                String name2 = (o1 != null) ? ((DataNode) o2).getName() : null;
                return Util.nullSafeCompare(true, name1, name2);
            }
        });
       
        return new TransformIterator(nodes.iterator(), tr);
    }
View Full Code Here

                return ((DataMap) input).getName();
            }
        };

        Collection<DataMap> maps = findNode(domainName, nodeName).getDataMaps();
        return new TransformIterator(maps.iterator(), tr);
    }
View Full Code Here

                stale = true;

                NodeId id = getId();
                Path path = id.getPath();

                Iterator propertyIds = new TransformIterator(new FilterIterator(itemInfos.iterator(),
                        new Predicate() {
                            public boolean evaluate(Object object) {
                                return object instanceof PropertyInfo;
                            }
                        }),
                        new Transformer() {
                            public Object transform(Object input) {
                                PropertyInfo info = (PropertyInfo) input;
                                return info.getId();
                            }});

                Iterator childInfos = new TransformIterator(itemInfos.iterator(), new Transformer(){
                    public Object transform(Object input) {
                        ItemInfo info = (ItemInfo) input;
                        Name name = info.getPath().getNameElement().getName();
                        return new ChildInfoImpl(name, null, Path.INDEX_DEFAULT);
                    }});
View Full Code Here

    @SuppressWarnings("unchecked")
    @Nonnull
    public static <T, R, S extends T> Iterator<R> map(Iterator<? extends T> iterator,
            final Function1<S, ? super R> f) {

        return new TransformIterator(iterator, new org.apache.commons.collections.Transformer() {
            @Override
            public Object transform(Object input) {
                return f.apply((S) input);
            }
        });
View Full Code Here

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

            public Object transform(Object input) {
                return ((DataDomain) input).getName();
            }
        };
        return new TransformIterator(config.getDomains().iterator(), tr);
    }
View Full Code Here

            public Object transform(Object input) {
                return ((DataMap) input).getName();
            }
        };
        return new TransformIterator(maps.iterator(), tr);
    }
View Full Code Here

                String name2 = (o1 != null) ? ((DataNode) o2).getName() : null;
                return Util.nullSafeCompare(true, name1, name2);
            }
        });

        return new TransformIterator(nodes.iterator(), tr);
    }
View Full Code Here

                return ((DataMap) input).getName();
            }
        };

        Collection<DataMap> maps = findNode(domainName, nodeName).getDataMaps();
        return new TransformIterator(maps.iterator(), tr);
    }
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.