Package org.apache.commons.collections.iterators

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


    public final TripleCollection getData() {
        return data;
    }
    @SuppressWarnings("unchecked")
    public Iterator<PlainLiteral> getText(UriRef field) {
        return new FilterIterator(new TransformIterator(data.filter(uri, field, null), TRIPLE2OBJECT), PLAIN_LITERALS);
    }
View Full Code Here


    public Iterator<PlainLiteral> getText(UriRef field) {
        return new FilterIterator(new TransformIterator(data.filter(uri, field, null), TRIPLE2OBJECT), PLAIN_LITERALS);
    }
    @SuppressWarnings("unchecked")
    public Iterator<UriRef> getReferences(UriRef field){
        return new FilterIterator(new TransformIterator(data.filter(uri, field, null), TRIPLE2OBJECT), REFERENCES);
    }
View Full Code Here

                stale = true;

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

                Iterator<ItemInfo> 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<ItemInfo> 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

   {
      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) {
          return null;
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Iterator getKeys(String prefix)
    {
        return new TransformIterator(parent.getKeys(getParentKey(prefix)), new Transformer()
        {
            public Object transform(Object obj)
            {
                return getChildKey((String) obj);
            }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Iterator getKeys()
    {
        return new TransformIterator(parent.getKeys(prefix), new Transformer()
        {
            public Object transform(Object obj)
            {
                return getChildKey((String) obj);
            }
View Full Code Here

        return effects != null ? effects : Collections.<String, Initializer>emptyMap();
    }

    public String getEffectNames()
    {
        Iterator eventNameIter = new TransformIterator(getEffectInitializerIterator(), new Transformer()
        {
            public Object transform(Object object)
            {
                return TextGen.quoteWord(((EffectInitializer)object).getName());
            }
View Full Code Here

        return TextGen.toCommaList(eventNameIter);
    }

    public String getEffectEventNames()
    {
        Iterator eventNameIter = new TransformIterator(getEffectInitializerIterator(), new Transformer()
        {
            public Object transform(Object object)
            {
                return TextGen.quoteWord(((EffectInitializer)object).getEventName());
            }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Iterator getKeys(String prefix)
    {
        return new TransformIterator(parent.getKeys(getParentKey(prefix)), new Transformer()
        {
            public Object transform(Object obj)
            {
                return getChildKey((String) obj);
            }
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.